'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
+ 'earwig.sounds',
'earwig.users',
]
--- /dev/null
+# earwig
+# Copyright (C) 2018 Frederic Peters
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Affero General Public License as published
+# by the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from django.contrib import admin
+from .models import Channel, Sound
+
+admin.site.register(Channel)
+admin.site.register(Sound)
--- /dev/null
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.11 on 2018-09-01 08:53
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ initial = True
+
+ dependencies = [
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='Channel',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('channel_url', models.URLField(verbose_name='Channel URL')),
+ ('title', models.CharField(max_length=200, verbose_name='Title')),
+ ('feed_url', models.URLField(blank=True, verbose_name='Feed URL')),
+ ('creation_timestamp', models.DateTimeField(auto_now_add=True)),
+ ('last_update_timestamp', models.DateTimeField(auto_now=True)),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Sound',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('sound_url', models.URLField(verbose_name='Sound URL')),
+ ('title', models.CharField(max_length=200, verbose_name='Title')),
+ ('description', models.TextField(blank=True, verbose_name='Description')),
+ ('page_url', models.URLField(blank=True, verbose_name='Page URL')),
+ ('uuid', models.CharField(blank=True, max_length=200, null=True, verbose_name='Unique Identifier')),
+ ('original_publication_date', models.DateTimeField(blank=True, null=True, verbose_name='Original Publication Date')),
+ ('file_type', models.CharField(blank=True, max_length=20, null=True, verbose_name='File Type')),
+ ('file_size', models.IntegerField(blank=True, null=True, verbose_name='File Size')),
+ ('duration', models.IntegerField(blank=True, null=True, verbose_name='Duration')),
+ ('creation_timestamp', models.DateTimeField(auto_now_add=True)),
+ ('last_update_timestamp', models.DateTimeField(auto_now=True)),
+ ('channel', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='sounds.Channel')),
+ ],
+ ),
+ ]
--- /dev/null
+# earwig
+# Copyright (C) 2018 Frederic Peters
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Affero General Public License as published
+# by the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from django.db import models
+from django.utils.translation import ugettext_lazy as _
+
+
+class Channel(models.Model):
+ channel_url = models.URLField(_('Channel URL'))
+ title = models.CharField(_('Title'), max_length=200)
+ feed_url = models.URLField(_('Feed URL'), blank=True)
+
+ creation_timestamp = models.DateTimeField(auto_now_add=True)
+ last_update_timestamp = models.DateTimeField(auto_now=True)
+
+ def __str__(self):
+ return self.title
+
+
+class Sound(models.Model):
+ sound_url = models.URLField(_('Sound URL'))
+ title = models.CharField(_('Title'), max_length=200)
+ description = models.TextField(_('Description'), blank=True)
+ page_url = models.URLField(_('Page URL'), blank=True)
+ uuid = models.CharField(_('Unique Identifier'), max_length=200, blank=True, null=True)
+ channel = models.ForeignKey('Channel', on_delete=models.SET_NULL, blank=True, null=True)
+
+ original_publication_date = models.DateTimeField(
+ _('Original Publication Date'), blank=True, null=True)
+ file_type = models.CharField(_('File Type'), max_length=20, blank=True, null=True)
+ file_size = models.IntegerField(_('File Size'), blank=True, null=True)
+ duration = models.IntegerField(_('Duration'), blank=True, null=True) # in seconds
+
+ creation_timestamp = models.DateTimeField(auto_now_add=True)
+ last_update_timestamp = models.DateTimeField(auto_now=True)
+
+ def __str__(self):
+ return self.title