Пример #1
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Album',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=250, verbose_name='Название')),
                ('image', models.ImageField(upload_to=albums.models.Album.get_picture_url, verbose_name='Изображение')),
            ],
            options={
                'verbose_name': 'Альбом',
                'verbose_name_plural': 'Альбомы',
            },
        ),
        migrations.CreateModel(
            name='ImageInAlbum',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to=albums.models.ImageInAlbum.get_picture_url, verbose_name='Изображение')),
                ('album', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='images', to='albums.Album', verbose_name='Альбом')),
            ],
            options={
                'verbose_name': 'Изображение',
                'verbose_name_plural': 'Изображения',
            },
        ),
    ]
Пример #2
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Album',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('title',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('cover',
                 models.ImageField(
                     default='default_cover_pic.jpeg',
                     null=True,
                     upload_to=albums.models.cover_image_file_path)),
                ('is_private', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='album_user',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Photo',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('photo',
                 models.ImageField(
                     upload_to=albums.models.album_image_file_path)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('album',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='photo_album',
                                   to='albums.album')),
            ],
        ),
    ]
Пример #3
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Album',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=250, null=True)),
                ('album',
                 models.ImageField(
                     blank=True,
                     upload_to=albums.models.group_based_upload_to_album)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('name', ),
            },
        ),
    ]
Пример #4
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.AlterField(
            model_name='album',
            name='coverpic',
            field=models.ImageField(upload_to=albums.models.coverpic_path),
        ),
        migrations.AlterField(
            model_name='album',
            name='time',
            field=models.DateTimeField(default=datetime.datetime(2020, 6, 7, 0, 32, 24, 308715, tzinfo=utc)),
        ),
        migrations.AlterField(
            model_name='albumphoto',
            name='photo',
            field=models.ImageField(upload_to='albums/<function album_folder at 0x000001F663D44DC0>'),
        ),
        migrations.AlterField(
            model_name='albumphoto',
            name='thumb',
            field=models.ImageField(upload_to='albums/<function album_folder at 0x000001F663D44DC0>/thumbs'),
        ),
        migrations.AlterField(
            model_name='albumphoto',
            name='time',
            field=models.DateTimeField(default=datetime.datetime(2020, 6, 7, 0, 32, 24, 309720, tzinfo=utc)),
        ),
        migrations.AlterField(
            model_name='comment',
            name='time',
            field=models.DateTimeField(default=datetime.datetime(2020, 6, 7, 0, 32, 24, 310715, tzinfo=utc)),
        ),
    ]
class Migration(migrations.Migration):

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

    operations = [
        migrations.AlterField(
            model_name='album',
            name='cover',
            field=models.ImageField(default='default/album_avatar.jpg',
                                    upload_to=albums.models.album_cover_path),
        ),
    ]
Пример #6
0
class Migration(migrations.Migration):

    dependencies = [
        ('albums', '0004_auto_20200607_0703'),
    ]

    operations = [
        migrations.AlterField(
            model_name='album',
            name='time',
            field=models.DateTimeField(default=datetime.datetime(
                2020, 6, 7, 8, 7, 35, 758054, tzinfo=utc)),
        ),
        migrations.AlterField(
            model_name='albumphoto',
            name='photo',
            field=models.ImageField(upload_to=albums.models.album_folder),
        ),
        migrations.AlterField(
            model_name='albumphoto',
            name='thumb',
            field=models.ImageField(upload_to=albums.models.thumb_folder),
        ),
        migrations.AlterField(
            model_name='albumphoto',
            name='time',
            field=models.DateTimeField(default=datetime.datetime(
                2020, 6, 7, 8, 7, 35, 759054, tzinfo=utc)),
        ),
        migrations.AlterField(
            model_name='comment',
            name='time',
            field=models.DateTimeField(default=datetime.datetime(
                2020, 6, 7, 8, 7, 35, 760054, tzinfo=utc)),
        ),
    ]
Пример #7
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('albums', '0002_auto_20170822_1006'),
    ]

    operations = [
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('logo', models.ImageField(blank=True, upload_to=albums.models.group_based_upload_to_Image)),
                ('album', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='albums.Album')),
                ('user', models.ForeignKey(default='1', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Пример #8
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Album',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('album_stub', models.CharField(max_length=100)),
                ('title', models.CharField(max_length=100)),
                ('description', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='AlbumItem',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('type', models.CharField(max_length=10)),
                ('file',
                 models.ImageField(
                     upload_to=albums.models.user_directory_path)),
                ('title', models.CharField(max_length=100)),
                ('description', models.TextField()),
                ('album',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='albums.Album')),
            ],
        ),
    ]