Esempio n. 1
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('banner', '0002_delete'),
    ]

    operations = [
        migrations.CreateModel(
            name='SliderBanner',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435')),
                ('is_active', models.BooleanField(default=False, verbose_name='\u0430\u043a\u0442\u0438\u0432\u043d\u043e')),
                ('image', models.FileField(blank=True, null=True, upload_to=banner.models.make_call_upload_path, verbose_name='\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435')),
                ('image_ru', models.FileField(blank=True, null=True, upload_to=banner.models.make_call_upload_path, verbose_name='\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435')),
                ('image_uk', models.FileField(blank=True, null=True, upload_to=banner.models.make_call_upload_path, verbose_name='\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435')),
                ('image_hu', models.FileField(blank=True, null=True, upload_to=banner.models.make_call_upload_path, verbose_name='\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435')),
                ('url', models.URLField(blank=True, max_length=512, verbose_name=b'\xd1\x81\xd1\x81\xd1\x8b\xd0\xbb\xd0\xba\xd0\xb0')),
                ('order', models.PositiveIntegerField(default=10, verbose_name='\u043f\u043e\u0440\u044f\u0434\u043e\u043a')),
            ],
            options={
                'verbose_name': '\u0431\u0430\u043d\u043d\u0435\u0440 \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430',
                'verbose_name_plural': '\u0431\u0430\u043d\u043d\u0435\u0440\u044b \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430',
            },
        ),
    ]
Esempio n. 2
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Banner',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=100, verbose_name='标题')),
                ('summary', models.TextField(blank=True, null=True, verbose_name='摘要')),
                ('img', models.FileField(upload_to=banner.models.carousel_img_path, verbose_name='轮播图片')),
                ('img_xs', models.FileField(upload_to=banner.models.carousel_img_path, verbose_name='手机轮播图片')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='article.Article', verbose_name='文章')),
            ],
            options={
                'verbose_name': '轮播图',
                'verbose_name_plural': '轮播图',
                'ordering': ['-create_time'],
            },
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('banner', '0005_auto_20171201_0225'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='banner',
            options={
                'verbose_name': '\u0431\u0430\u043d\u043d\u0435\u0440',
                'verbose_name_plural':
                '\u0431\u0430\u043d\u043d\u0435\u0440\u044b'
            },
        ),
        migrations.AddField(
            model_name='banner',
            name='image_bg',
            field=models.FileField(
                blank=True,
                null=True,
                upload_to=banner.models.make_call_upload_path,
                verbose_name=
                '\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0444\u043e\u043d\u0430'
            ),
        ),
        migrations.AddField(
            model_name='banner',
            name='image_bg_hu',
            field=models.FileField(
                blank=True,
                null=True,
                upload_to=banner.models.make_call_upload_path,
                verbose_name=
                '\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0444\u043e\u043d\u0430'
            ),
        ),
        migrations.AddField(
            model_name='banner',
            name='image_bg_ru',
            field=models.FileField(
                blank=True,
                null=True,
                upload_to=banner.models.make_call_upload_path,
                verbose_name=
                '\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0444\u043e\u043d\u0430'
            ),
        ),
        migrations.AddField(
            model_name='banner',
            name='image_bg_uk',
            field=models.FileField(
                blank=True,
                null=True,
                upload_to=banner.models.make_call_upload_path,
                verbose_name=
                '\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0444\u043e\u043d\u0430'
            ),
        ),
        migrations.AddField(
            model_name='banner',
            name='place',
            field=models.CharField(
                choices=
                [(b'slider',
                  '\u0441\u043b\u0430\u0439\u0434\u0435\u0440 \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0439'
                  ), (b'topline', 'topline'), (b'catfish', 'catfish')],
                default='slider',
                max_length=10,
                verbose_name=
                '\u0431\u0430\u043d\u043d\u0435\u0440\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e'
            ),
            preserve_default=False,
        ),
    ]
Esempio n. 4
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Banner',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('start',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='start')),
                ('end',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='end')),
                ('title', models.CharField(max_length=80,
                                           verbose_name='title')),
                ('status',
                 models.IntegerField(choices=[(0, 'enabled'), (1, 'disabled')],
                                     db_index=True,
                                     default=0,
                                     verbose_name='status')),
            ],
            options={
                'verbose_name': 'banner',
                'verbose_name_plural': 'banners',
            },
        ),
        migrations.CreateModel(
            name='BannerItem',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('title', models.CharField(max_length=80,
                                           verbose_name='title')),
                ('url', models.URLField(verbose_name='url')),
                ('description',
                 models.TextField(blank=True,
                                  null=True,
                                  verbose_name='description')),
                ('target',
                 models.IntegerField(choices=[(0, '_self'), (1, 'blank')],
                                     default=0,
                                     verbose_name='target')),
                ('position',
                 models.IntegerField(default=0, verbose_name='position')),
                ('status',
                 models.IntegerField(choices=[(0, 'visible'), (1, 'hidden')],
                                     db_index=True,
                                     default=0,
                                     verbose_name='status')),
                ('thumbnail',
                 easy_thumbnails.fields.ThumbnailerImageField(
                     blank=True,
                     null=True,
                     upload_to=banner.models.upload_directory_path,
                     verbose_name='thumbnail')),
                ('banner',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='banners',
                     to='banner.Banner',
                     verbose_name='banner')),
            ],
            options={
                'verbose_name': 'banner item',
                'verbose_name_plural': 'banner items',
            },
        ),
    ]