Exemplo n.º 1
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='album',
            fields=[
                ('album_id', models.AutoField(primary_key=True, serialize=False)),
                ('album_name', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='hashtag',
            fields=[
                ('hashtag_id', models.AutoField(primary_key=True, serialize=False)),
                ('hashtags', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='language',
            fields=[
                ('language_id', models.AutoField(primary_key=True, serialize=False)),
                ('languages', models.CharField(max_length=30)),
            ],
        ),
        migrations.CreateModel(
            name='mood',
            fields=[
                ('mood_id', models.AutoField(primary_key=True, serialize=False)),
                ('moods', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='vocalist',
            fields=[
                ('vocalist_id', models.AutoField(primary_key=True, serialize=False)),
                ('vocalist_name', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='song',
            fields=[
                ('song_id', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=100)),
                ('thumbnail', models.ImageField(upload_to='thumbnails')),
                ('audio_file', models.FileField(blank=True, upload_to='media/songs', validators=[audio.models.validate_file_extension])),
                ('uploaded_at', models.DateTimeField(auto_now_add=True)),
                ('album_name', models.ManyToManyField(blank=True, to='audio.album')),
                ('hashtags', models.ManyToManyField(blank=True, to='audio.hashtag')),
                ('languages', models.ManyToManyField(blank=True, to='audio.language')),
                ('moods', models.ManyToManyField(blank=True, to='audio.mood')),
                ('vocalist_name', models.ManyToManyField(blank=True, to='audio.vocalist')),
            ],
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('audio', '0002_auto_20161203_0121'),
    ]

    operations = [
        migrations.AlterField(
            model_name='audio',
            name='audio',
            field=models.FileField(max_length=250,
                                   upload_to=audio.models.audio_file_upload_to,
                                   verbose_name='audio'),
        ),
    ]
Exemplo n.º 3
0
class Migration(migrations.Migration):

    dependencies = [
        ('audio', '0001_initial'),
    ]

    operations = [
        migrations.AlterField(
            model_name='song',
            name='audio_file',
            field=models.FileField(
                blank=True,
                null=True,
                upload_to='songs',
                validators=[audio.models.validate_file_extension]),
        ),
        migrations.AlterField(
            model_name='song',
            name='thumbnail',
            field=models.ImageField(blank=True,
                                    null=True,
                                    upload_to='thumbnails'),
        ),
    ]
Exemplo n.º 4
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Feed',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('author', models.CharField(max_length=255)),
                ('title', models.CharField(max_length=255)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('slug', models.SlugField(max_length=255, unique=True)),
                ('description', models.TextField()),
                ('image', models.ImageField(blank=True, null=True, storage=django.core.files.storage.FileSystemStorage(location='/home/trent/trentpalmerdotorg/media/audio/images'), upload_to=audio.models.slugify_file_name)),
                ('image_license', models.SmallIntegerField(choices=[(1, 'Public Domain'), (2, 'Unknown'), (3, 'CC BY-SA 2.5'), (4, 'CC BY-SA 3.0'), (5, 'CC BY 3.0'), (6, 'CC BY 1.0'), (7, 'CC0 1.0'), (8, 'CC BY 4.0')], default=2)),
                ('image_title', models.CharField(default='', max_length=255)),
                ('image_attribution', models.CharField(default='', max_length=255)),
                ('image_attribution_url', models.URLField(blank=True, max_length=255)),
                ('original_image_url', models.URLField(default='', max_length=255)),
                ('image_license_jurisdiction', models.TextField(default='(no jurisdiction specified)')),
                ('author_url', models.URLField(default='', max_length=255)),
                ('ebook_title', models.CharField(default='', max_length=255)),
                ('ebook_url', models.URLField(default='', max_length=255)),
                ('translator', models.CharField(blank=True, max_length=255)),
                ('translator_url', models.URLField(blank=True, max_length=255)),
                ('intro_author', models.CharField(blank=True, max_length=255)),
                ('intro_author_url', models.URLField(blank=True, max_length=255)),
                ('license_jurisdiction', models.TextField(blank=True, default='(no jurisdiction specified)')),
                ('license', models.SmallIntegerField(choices=[(1, 'Public Domain'), (2, 'Unknown'), (3, 'CC BY-SA 2.5'), (4, 'CC BY-SA 3.0'), (5, 'CC BY 3.0'), (6, 'CC BY 1.0'), (7, 'CC0 1.0'), (8, 'CC BY 4.0')], default=1)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Episode',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('author', models.CharField(max_length=255)),
                ('title', models.CharField(max_length=255)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('slug', models.SlugField(max_length=255, unique=True)),
                ('description', models.TextField()),
                ('image', models.ImageField(blank=True, null=True, storage=django.core.files.storage.FileSystemStorage(location='/home/trent/trentpalmerdotorg/media/audio/images'), upload_to=audio.models.slugify_file_name)),
                ('image_license', models.SmallIntegerField(choices=[(1, 'Public Domain'), (2, 'Unknown'), (3, 'CC BY-SA 2.5'), (4, 'CC BY-SA 3.0'), (5, 'CC BY 3.0'), (6, 'CC BY 1.0'), (7, 'CC0 1.0'), (8, 'CC BY 4.0')], default=2)),
                ('image_title', models.CharField(default='', max_length=255)),
                ('image_attribution', models.CharField(default='', max_length=255)),
                ('image_attribution_url', models.URLField(blank=True, max_length=255)),
                ('original_image_url', models.URLField(default='', max_length=255)),
                ('image_license_jurisdiction', models.TextField(default='(no jurisdiction specified)')),
                ('pub_date', models.DateField()),
                ('episode_number', models.IntegerField(null=True)),
                ('mp3', models.FileField(blank=True, null=True, storage=django.core.files.storage.FileSystemStorage(location='/home/trent/trentpalmerdotorg/media/audio/mp3'), upload_to=audio.models.slugify_file_name)),
                ('feed', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='audio.feed')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
    ]