コード例 #1
0
class Migration(migrations.Migration):

    dependencies = [
        ('cms', '0017_subject_grade'),
    ]

    operations = [
        migrations.AlterField(
            model_name='chapter',
            name='poster_image',
            field=models.ImageField(blank=True,
                                    height_field='height_field',
                                    null=True,
                                    upload_to=cms.models.poster_upload,
                                    width_field='width_field'),
        ),
        migrations.AlterField(
            model_name='numerical',
            name='display_image',
            field=models.ImageField(blank=True,
                                    height_field='height_field',
                                    null=True,
                                    upload_to=cms.models.image_upload,
                                    width_field='width_field'),
        ),
        migrations.AlterField(
            model_name='saq',
            name='display_image',
            field=models.ImageField(blank=True,
                                    height_field='height_field',
                                    null=True,
                                    upload_to=cms.models.image_upload,
                                    width_field='width_field'),
        ),
        migrations.AlterField(
            model_name='subject',
            name='poster_image',
            field=models.ImageField(blank=True,
                                    height_field='height_field',
                                    null=True,
                                    upload_to=cms.models.poster_upload,
                                    width_field='width_field'),
        ),
        migrations.AlterField(
            model_name='subtopic',
            name='poster_image',
            field=models.ImageField(blank=True,
                                    height_field='height_field',
                                    null=True,
                                    upload_to=cms.models.poster_upload,
                                    width_field='width_field'),
        ),
    ]
コード例 #2
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.AlterModelOptions(
            name='bannerimage',
            options={'verbose_name': 'Imagem', 'verbose_name_plural': 'Imagens'},
        ),
        migrations.RemoveField(
            model_name='banner',
            name='name',
        ),
        migrations.AddField(
            model_name='banner',
            name='description',
            field=models.TextField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='banner',
            name='title',
            field=models.CharField(default='a', max_length=255, verbose_name='Titulo'),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='bannerimage',
            name='file',
            field=models.ImageField(upload_to=cms.models.handle_image_file, verbose_name='Imagem'),
        ),
    ]
コード例 #3
0
class Migration(migrations.Migration):

    dependencies = [
        ('cms', '0003_auto_20191020_2317'),
    ]

    operations = [
        migrations.CreateModel(
            name='Content',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('type',
                 utils.intenum.IntEnumField(
                     choices=[(0, 'page'), (1, 'news')],
                     default=0,
                     validators=[
                         utils.intenum.IntEnumValidator(
                             cms.models.ContentTypeChoices)
                     ])),
                ('title_fa', models.CharField(max_length=500)),
                ('title_en', models.CharField(default='', max_length=500)),
                ('text_fa', ckeditor.fields.RichTextField()),
                ('text_en', ckeditor.fields.RichTextField(default='')),
                ('image',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to='images/posts')),
                ('created_date',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('published_date',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('category',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='cms.Category')),
                ('tags', models.ManyToManyField(blank=True, to='cms.Tag')),
            ],
        ),
        migrations.RemoveField(
            model_name='page',
            name='category',
        ),
        migrations.RemoveField(
            model_name='page',
            name='tags',
        ),
        migrations.DeleteModel(name='News', ),
        migrations.DeleteModel(name='Page', ),
    ]
コード例 #4
0
class Migration(migrations.Migration):

    dependencies = [
        ('cms', '0020_auto_20171208_0906'),
    ]

    operations = [
        migrations.AlterField(
            model_name='chapter',
            name='poster_image',
            field=models.ImageField(blank=True, height_field='height_field', null=True, upload_to=cms.models.poster_upload, width_field='width_field'),
        ),
    ]
コード例 #5
0
class Migration(migrations.Migration):

    dependencies = [
        ('cms', '0006_auto_20170609_1931'),
    ]

    operations = [
        migrations.AddField(
            model_name='site',
            name='when_image',
            field=models.ImageField(default=1, upload_to=cms.models.upload_to),
            preserve_default=False,
        ),
    ]
コード例 #6
0
class Migration(migrations.Migration):

    dependencies = [
        ('cms', '0008_therapy_large_image'),
    ]

    operations = [
        migrations.AddField(
            model_name='therapist',
            name='image',
            field=models.ImageField(default=1,
                                    upload_to=cms.models.upload_to_therapist),
            preserve_default=False,
        ),
    ]
コード例 #7
0
class Migration(migrations.Migration):

    dependencies = [
        ('cms', '0005_auto_20170605_1628'),
    ]

    operations = [
        migrations.AddField(
            model_name='site',
            name='who_image',
            field=models.ImageField(default=1, upload_to=cms.models.upload_to),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='site',
            name='title',
            field=models.CharField(default='Illic', max_length=140),
        ),
    ]
コード例 #8
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')),
                ('name', models.CharField(max_length=255,
                                          verbose_name='Nome')),
                ('width', models.PositiveIntegerField(verbose_name='Largura')),
                ('height', models.PositiveIntegerField(verbose_name='Altura')),
            ],
        ),
        migrations.CreateModel(
            name='BannerImage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('file',
                 models.ImageField(upload_to=cms.models.handle_image_file)),
                ('banner',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='images',
                                   to='cms.Banner',
                                   verbose_name='Imagem do Banner')),
            ],
        ),
    ]
コード例 #9
0
class Migration(migrations.Migration):

    dependencies = [
        ('cms', '0003_auto_20170605_0351'),
    ]

    operations = [
        migrations.CreateModel(
            name='Therapist',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('order',
                 models.PositiveIntegerField(db_index=True,
                                             default=0,
                                             editable=False)),
                ('title',
                 models.CharField(default='Terapia',
                                  max_length=140,
                                  verbose_name='Nombre')),
                ('slug', models.CharField(editable=False, max_length=200)),
                ('phone', models.CharField(max_length=140)),
                ('address', models.CharField(max_length=250)),
                ('google_maps', models.URLField(max_length=250)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AlterField(
            model_name='site',
            name='preview_image',
            field=models.ImageField(upload_to=cms.models.upload_to),
        ),
    ]
コード例 #10
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.AddField(
            model_name='site',
            name='facebook',
            field=models.URLField(default='https://www.facebook.com/', max_length=140),
        ),
        migrations.AddField(
            model_name='site',
            name='preview_image',
            field=models.ImageField(default=1, upload_to=cms.models.upload_to_therapy),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='site',
            name='twitter',
            field=models.URLField(default='https://twitter.com/', max_length=140),
        ),
    ]
コード例 #11
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='AttributeType',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('order',
                 models.PositiveIntegerField(default=1, verbose_name='order')),
                ('publish',
                 models.BooleanField(default=True, verbose_name='publish')),
                ('uid',
                 models.UUIDField(
                     default=uuid.uuid4,
                     editable=False,
                     help_text=
                     'Autogenerated unique id for this item in database',
                     verbose_name='unique id')),
                ('created',
                 django_extensions.db.fields.CreationDateTimeField(
                     auto_now_add=True, verbose_name='creation time')),
                ('modified',
                 django_extensions.db.fields.ModificationDateTimeField(
                     auto_now=True, verbose_name='modification time')),
                ('name',
                 models.CharField(max_length=100,
                                  unique=True,
                                  verbose_name='Name')),
                ('alternate_names',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.CharField(blank=True, max_length=100),
                     blank=True,
                     default=list,
                     null=True,
                     size=None,
                     verbose_name='Alternate names')),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('order',
                 models.PositiveIntegerField(default=1, verbose_name='order')),
                ('publish',
                 models.BooleanField(default=True, verbose_name='publish')),
                ('uid',
                 models.UUIDField(
                     default=uuid.uuid4,
                     editable=False,
                     help_text=
                     'Autogenerated unique id for this item in database',
                     verbose_name='unique id')),
                ('created',
                 django_extensions.db.fields.CreationDateTimeField(
                     auto_now_add=True, verbose_name='creation time')),
                ('modified',
                 django_extensions.db.fields.ModificationDateTimeField(
                     auto_now=True, verbose_name='modification time')),
                ('name',
                 models.CharField(max_length=100,
                                  unique=True,
                                  verbose_name='Name')),
                ('alternate_names',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.CharField(blank=True, max_length=100),
                     blank=True,
                     default=list,
                     null=True,
                     size=None,
                     verbose_name='Alternate names')),
                ('parent',
                 models.ForeignKey(blank=True,
                                   default=None,
                                   null=True,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   related_name='sub_categories',
                                   to='cms.category',
                                   verbose_name='Parent')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('order',
                 models.PositiveIntegerField(default=1, verbose_name='order')),
                ('publish',
                 models.BooleanField(default=True, verbose_name='publish')),
                ('uid',
                 models.UUIDField(
                     default=uuid.uuid4,
                     editable=False,
                     help_text=
                     'Autogenerated unique id for this item in database',
                     verbose_name='unique id')),
                ('created',
                 django_extensions.db.fields.CreationDateTimeField(
                     auto_now_add=True, verbose_name='creation time')),
                ('modified',
                 django_extensions.db.fields.ModificationDateTimeField(
                     auto_now=True, verbose_name='modification time')),
                ('model',
                 models.CharField(max_length=100,
                                  unique=True,
                                  verbose_name='Model')),
                ('alternate_models',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.CharField(blank=True, max_length=100),
                     blank=True,
                     default=list,
                     null=True,
                     size=None,
                     verbose_name='Alternate models')),
                ('category',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='cms.category',
                     verbose_name='Category')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Unit',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('order',
                 models.PositiveIntegerField(default=1, verbose_name='order')),
                ('publish',
                 models.BooleanField(default=True, verbose_name='publish')),
                ('uid',
                 models.UUIDField(
                     default=uuid.uuid4,
                     editable=False,
                     help_text=
                     'Autogenerated unique id for this item in database',
                     verbose_name='unique id')),
                ('created',
                 django_extensions.db.fields.CreationDateTimeField(
                     auto_now_add=True, verbose_name='creation time')),
                ('modified',
                 django_extensions.db.fields.ModificationDateTimeField(
                     auto_now=True, verbose_name='modification time')),
                ('name',
                 models.CharField(help_text='The unit name',
                                  max_length=100,
                                  unique=True,
                                  verbose_name='Name')),
                ('alternate_names',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.CharField(blank=True, max_length=100),
                     blank=True,
                     default=list,
                     null=True,
                     size=None,
                     verbose_name='Alternate names')),
                ('widget',
                 models.CharField(
                     choices=[
                         ('django.forms.widgets.TextInput', 'Text'),
                         ('django.forms.widgets.NumberInput',
                          'Number (integer)'),
                         ('cms.form_widgets.FloatInput', 'Number (decimal)'),
                         ('django.forms.widgets.CheckboxInput', 'Checkbox'),
                         ('django.forms.widgets.DateTimeInput', 'Date & Time')
                     ],
                     help_text=
                     "The input widget, which denotes the data type, serializer and deserializer of the unit's corresponding values.",
                     max_length=70,
                     verbose_name='widget')),
                ('repeat',
                 models.CharField(
                     blank=True,
                     choices=[('once', 'Once'), ('hourly', 'Hourly'),
                              ('daily', 'Daily'), ('weekly', 'Weekly'),
                              ('monthly', 'Monthly')],
                     default='once',
                     help_text=
                     'The frequency with which this unit should be tracked.',
                     max_length=100,
                     null=True,
                     verbose_name='Repeat')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Website',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('order',
                 models.PositiveIntegerField(default=1, verbose_name='order')),
                ('publish',
                 models.BooleanField(default=True, verbose_name='publish')),
                ('uid',
                 models.UUIDField(
                     default=uuid.uuid4,
                     editable=False,
                     help_text=
                     'Autogenerated unique id for this item in database',
                     verbose_name='unique id')),
                ('created',
                 django_extensions.db.fields.CreationDateTimeField(
                     auto_now_add=True, verbose_name='creation time')),
                ('modified',
                 django_extensions.db.fields.ModificationDateTimeField(
                     auto_now=True, verbose_name='modification time')),
                ('name',
                 models.CharField(help_text='The website name',
                                  max_length=100,
                                  unique=True,
                                  verbose_name='Name')),
                ('domain',
                 models.CharField(help_text='The website domain name',
                                  max_length=100,
                                  unique=True,
                                  verbose_name='Domain')),
                ('currency',
                 models.ForeignKey(
                     blank=True,
                     help_text='The currency this website trades in.',
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='websites',
                     to='cms.unit',
                     verbose_name='Currency')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='WebsiteProductAttribute',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('order',
                 models.PositiveIntegerField(default=1, verbose_name='order')),
                ('publish',
                 models.BooleanField(default=True, verbose_name='publish')),
                ('uid',
                 models.UUIDField(
                     default=uuid.uuid4,
                     editable=False,
                     help_text=
                     'Autogenerated unique id for this item in database',
                     verbose_name='unique id')),
                ('created',
                 django_extensions.db.fields.CreationDateTimeField(
                     auto_now_add=True, verbose_name='creation time')),
                ('modified',
                 django_extensions.db.fields.ModificationDateTimeField(
                     auto_now=True, verbose_name='modification time')),
                ('data',
                 models.JSONField(default=cms.models.json_data_default,
                                  help_text='The data for this attribute',
                                  null=True,
                                  verbose_name='Data')),
                ('attribute_type',
                 models.ForeignKey(
                     blank=True,
                     help_text='The data type for this attribute',
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='websiteproductattributes',
                     to='cms.attributetype',
                     verbose_name='Data type')),
                ('product',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='websiteproductattributes',
                                   to='cms.product',
                                   verbose_name='Product')),
                ('website',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='productattributes',
                                   to='cms.website',
                                   verbose_name='Website')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Url',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('order',
                 models.PositiveIntegerField(default=1, verbose_name='order')),
                ('publish',
                 models.BooleanField(default=True, verbose_name='publish')),
                ('uid',
                 models.UUIDField(
                     default=uuid.uuid4,
                     editable=False,
                     help_text=
                     'Autogenerated unique id for this item in database',
                     verbose_name='unique id')),
                ('created',
                 django_extensions.db.fields.CreationDateTimeField(
                     auto_now_add=True, verbose_name='creation time')),
                ('modified',
                 django_extensions.db.fields.ModificationDateTimeField(
                     auto_now=True, verbose_name='modification time')),
                ('url',
                 models.CharField(help_text='The page url',
                                  max_length=100,
                                  unique=True,
                                  verbose_name='Url')),
                ('url_type',
                 models.CharField(choices=[('category', 'Category'),
                                           ('product', 'Product')],
                                  max_length=100,
                                  verbose_name='Type')),
                ('last_scanned',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='Last scanned')),
                ('category',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='urls',
                     to='cms.category')),
                ('website',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='urls',
                                   to='cms.website')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Selector',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('order',
                 models.PositiveIntegerField(default=1, verbose_name='order')),
                ('publish',
                 models.BooleanField(default=True, verbose_name='publish')),
                ('uid',
                 models.UUIDField(
                     default=uuid.uuid4,
                     editable=False,
                     help_text=
                     'Autogenerated unique id for this item in database',
                     verbose_name='unique id')),
                ('created',
                 django_extensions.db.fields.CreationDateTimeField(
                     auto_now_add=True, verbose_name='creation time')),
                ('modified',
                 django_extensions.db.fields.ModificationDateTimeField(
                     auto_now=True, verbose_name='modification time')),
                ('selector_type',
                 models.CharField(choices=[
                     ('model', 'Model'), ('price', 'Price'), ('text', 'Text'),
                     ('table', 'Table'), ('image', 'Image'), ('link', 'Link'),
                     ('pagination', 'Pagination'),
                     ('table_value_column', 'Table Value Column'),
                     ('table_label_column', 'Table Label Column')
                 ],
                                  max_length=100,
                                  verbose_name='Type')),
                ('css_selector',
                 models.CharField(
                     help_text='The CSS selector used to find page data.',
                     max_length=100,
                     verbose_name='CSS Selector')),
                ('regex',
                 models.CharField(
                     blank=True,
                     help_text='A regular expression used to extract data',
                     max_length=100,
                     null=True,
                     verbose_name='Regular Expression')),
                ('parent',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='sub_selectors',
                     to='cms.selector',
                     verbose_name='Parent')),
                ('website',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='selectors',
                                   to='cms.website')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ProductImage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('order',
                 models.PositiveIntegerField(default=1, verbose_name='order')),
                ('publish',
                 models.BooleanField(default=True, verbose_name='publish')),
                ('uid',
                 models.UUIDField(
                     default=uuid.uuid4,
                     editable=False,
                     help_text=
                     'Autogenerated unique id for this item in database',
                     verbose_name='unique id')),
                ('created',
                 django_extensions.db.fields.CreationDateTimeField(
                     auto_now_add=True, verbose_name='creation time')),
                ('modified',
                 django_extensions.db.fields.ModificationDateTimeField(
                     auto_now=True, verbose_name='modification time')),
                ('image_type',
                 models.CharField(choices=[('main', 'Main'),
                                           ('thumbnail', 'Thumbnail')],
                                  max_length=100,
                                  verbose_name='Type')),
                ('image',
                 models.ImageField(upload_to='product_images/',
                                   verbose_name='image')),
                ('product',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='images',
                                   to='cms.product',
                                   verbose_name='Product')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='attributetype',
            name='unit',
            field=models.ForeignKey(
                blank=True,
                help_text='The data type for this attribute',
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name='attribute_types',
                to='cms.unit',
                verbose_name='Data type'),
        ),
        migrations.CreateModel(
            name='ProductAttribute',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('order',
                 models.PositiveIntegerField(default=1, verbose_name='order')),
                ('publish',
                 models.BooleanField(default=True, verbose_name='publish')),
                ('uid',
                 models.UUIDField(
                     default=uuid.uuid4,
                     editable=False,
                     help_text=
                     'Autogenerated unique id for this item in database',
                     verbose_name='unique id')),
                ('created',
                 django_extensions.db.fields.CreationDateTimeField(
                     auto_now_add=True, verbose_name='creation time')),
                ('modified',
                 django_extensions.db.fields.ModificationDateTimeField(
                     auto_now=True, verbose_name='modification time')),
                ('data',
                 models.JSONField(default=cms.models.json_data_default,
                                  help_text='The data for this attribute',
                                  null=True,
                                  verbose_name='Data')),
                ('attribute_type',
                 models.ForeignKey(
                     blank=True,
                     help_text='The data type for this attribute',
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='productattributes',
                     to='cms.attributetype',
                     verbose_name='Data type')),
                ('product',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='productattributes',
                                   to='cms.product',
                                   verbose_name='Product')),
            ],
            options={
                'unique_together': {('product', 'attribute_type')},
            },
        ),
        migrations.AlterUniqueTogether(
            name='attributetype',
            unique_together={('name', 'unit')},
        ),
    ]
コード例 #12
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='Categoria',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('estado',
                 models.CharField(choices=[('Activo', 'Activo'),
                                           ('Inactivo', 'Inactivo')],
                                  default=1,
                                  max_length=20,
                                  verbose_name='Estado')),
                ('titulo',
                 models.CharField(max_length=100, verbose_name='Título')),
                ('en_titulo',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=100,
                                  verbose_name='En Título')),
                ('subtitulo',
                 models.CharField(blank=True,
                                  max_length=100,
                                  verbose_name='Subtítulo')),
                ('en_subtitulo',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=100,
                                  verbose_name='En Subtítulo')),
                ('informacion',
                 ckeditor.fields.RichTextField(blank=True,
                                               verbose_name='Información')),
                ('en_informacion',
                 ckeditor.fields.RichTextField(blank=True,
                                               default='',
                                               verbose_name='En Información')),
                ('prioridad',
                 cms.models.IntegerRangeField(blank=True,
                                              null=True,
                                              verbose_name='Prioridad')),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Fecha Creación')),
                ('updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Fecha Actualización')),
                ('color',
                 models.CharField(blank=True,
                                  max_length=7,
                                  null=True,
                                  verbose_name='Color')),
                ('categoria_padre',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='parent_category',
                                   related_query_name='child_category',
                                   to='cms.Categoria',
                                   verbose_name='Categoría Padre')),
            ],
            options={
                'verbose_name': 'Categoría',
                'verbose_name_plural': 'Categorías',
            },
        ),
        migrations.CreateModel(
            name='Horario',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('estado',
                 models.CharField(choices=[('Activo', 'Activo'),
                                           ('Inactivo', 'Inactivo')],
                                  default=1,
                                  max_length=20,
                                  verbose_name='Estado')),
                ('titulo',
                 models.CharField(max_length=100, verbose_name='Título')),
                ('en_titulo',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=100,
                                  verbose_name='En Título')),
                ('subtitulo',
                 models.CharField(blank=True,
                                  max_length=100,
                                  verbose_name='Subtítulo')),
                ('en_subtitulo',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=100,
                                  verbose_name='En Subtítulo')),
                ('informacion',
                 ckeditor.fields.RichTextField(blank=True,
                                               verbose_name='Información')),
                ('en_informacion',
                 ckeditor.fields.RichTextField(blank=True,
                                               default='',
                                               verbose_name='En Información')),
                ('prioridad',
                 cms.models.IntegerRangeField(blank=True,
                                              null=True,
                                              verbose_name='Prioridad')),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Fecha Creación')),
                ('updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Fecha Actualización')),
            ],
            options={
                'verbose_name': 'Horario',
                'verbose_name_plural': 'Horarios',
            },
        ),
        migrations.CreateModel(
            name='Lugar',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('estado',
                 models.CharField(choices=[('Activo', 'Activo'),
                                           ('Inactivo', 'Inactivo')],
                                  default=1,
                                  max_length=20,
                                  verbose_name='Estado')),
                ('titulo',
                 models.CharField(max_length=100, verbose_name='Título')),
                ('en_titulo',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=100,
                                  verbose_name='En Título')),
                ('subtitulo',
                 models.CharField(blank=True,
                                  max_length=100,
                                  verbose_name='Subtítulo')),
                ('en_subtitulo',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=100,
                                  verbose_name='En Subtítulo')),
                ('informacion',
                 ckeditor.fields.RichTextField(blank=True,
                                               verbose_name='Información')),
                ('en_informacion',
                 ckeditor.fields.RichTextField(blank=True,
                                               default='',
                                               verbose_name='En Información')),
                ('prioridad',
                 cms.models.IntegerRangeField(blank=True,
                                              null=True,
                                              verbose_name='Prioridad')),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Fecha Creación')),
                ('updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Fecha Actualización')),
                ('puntuacion',
                 cms.models.IntegerRangeField(blank=True,
                                              null=True,
                                              verbose_name='Puntuación')),
                ('destacado',
                 models.BooleanField(blank=True,
                                     default=False,
                                     verbose_name='Destacado')),
                ('servicios',
                 models.TextField(blank=True,
                                  default='',
                                  verbose_name='Servicios')),
                ('en_servicios',
                 models.TextField(blank=True,
                                  default='',
                                  verbose_name='En Servicios')),
                ('latitud',
                 models.CharField(blank=True,
                                  max_length=20,
                                  null=True,
                                  verbose_name='Latitud')),
                ('longitud',
                 models.CharField(blank=True,
                                  max_length=20,
                                  null=True,
                                  verbose_name='Longitud')),
                ('telefono1',
                 models.CharField(blank=True,
                                  max_length=20,
                                  null=True,
                                  verbose_name='Teléfono 1')),
                ('telefono2',
                 models.CharField(blank=True,
                                  max_length=20,
                                  null=True,
                                  verbose_name='Teléfono 2')),
                ('url',
                 models.URLField(blank=True,
                                 null=True,
                                 verbose_name='Pagina Web')),
                ('reserva',
                 models.URLField(blank=True,
                                 null=True,
                                 verbose_name='Reservar')),
                ('compra',
                 models.URLField(blank=True, null=True,
                                 verbose_name='Comprar')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   null=True,
                                   verbose_name='Email')),
                ('vista360',
                 models.URLField(blank=True,
                                 null=True,
                                 verbose_name='Vista 360')),
                ('facebook',
                 models.URLField(blank=True,
                                 null=True,
                                 verbose_name='Facebook')),
                ('twitter',
                 models.URLField(blank=True, null=True,
                                 verbose_name='Twitter')),
                ('instagram',
                 models.URLField(blank=True,
                                 null=True,
                                 verbose_name='Instagram')),
                ('categoria',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='place_category',
                                   to='cms.Categoria',
                                   verbose_name='Categoria')),
            ],
            options={
                'verbose_name': 'Lugar',
                'verbose_name_plural': 'Lugares',
            },
        ),
        migrations.CreateModel(
            name='Video',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('titulo',
                 models.CharField(max_length=100, verbose_name='Título')),
                ('video',
                 embed_video.fields.EmbedVideoField(verbose_name='Video Url')),
                ('object_id',
                 models.PositiveIntegerField(default=1,
                                             verbose_name='Objeto')),
                ('content_type',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='content_type_video',
                                   to='contenttypes.ContentType',
                                   verbose_name='Tipo')),
            ],
            options={
                'verbose_name': 'Video',
                'verbose_name_plural': 'Videos',
            },
        ),
        migrations.CreateModel(
            name='Publicacion',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('estado',
                 models.CharField(choices=[('Activo', 'Activo'),
                                           ('Inactivo', 'Inactivo')],
                                  default=1,
                                  max_length=20,
                                  verbose_name='Estado')),
                ('titulo',
                 models.CharField(max_length=100, verbose_name='Título')),
                ('en_titulo',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=100,
                                  verbose_name='En Título')),
                ('subtitulo',
                 models.CharField(blank=True,
                                  max_length=100,
                                  verbose_name='Subtítulo')),
                ('en_subtitulo',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=100,
                                  verbose_name='En Subtítulo')),
                ('informacion',
                 ckeditor.fields.RichTextField(blank=True,
                                               verbose_name='Información')),
                ('en_informacion',
                 ckeditor.fields.RichTextField(blank=True,
                                               default='',
                                               verbose_name='En Información')),
                ('prioridad',
                 cms.models.IntegerRangeField(blank=True,
                                              null=True,
                                              verbose_name='Prioridad')),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Fecha Creación')),
                ('updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Fecha Actualización')),
                ('tipo',
                 models.CharField(choices=[('Noticia', 'Noticia'),
                                           ('Evento', 'Evento')],
                                  default=1,
                                  max_length=20,
                                  verbose_name='Tipo')),
                ('categoria',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='publication_category',
                                   to='cms.Categoria',
                                   verbose_name='Categoría')),
            ],
            options={
                'verbose_name': 'Publicacion',
                'verbose_name_plural': 'Publicaciones',
            },
        ),
        migrations.CreateModel(
            name='Promo',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('estado',
                 models.CharField(choices=[('Activo', 'Activo'),
                                           ('Inactivo', 'Inactivo')],
                                  default=1,
                                  max_length=20,
                                  verbose_name='Estado')),
                ('titulo',
                 models.CharField(max_length=100, verbose_name='Título')),
                ('en_titulo',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=100,
                                  verbose_name='En Título')),
                ('subtitulo',
                 models.CharField(blank=True,
                                  max_length=100,
                                  verbose_name='Subtítulo')),
                ('en_subtitulo',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=100,
                                  verbose_name='En Subtítulo')),
                ('informacion',
                 ckeditor.fields.RichTextField(blank=True,
                                               verbose_name='Información')),
                ('en_informacion',
                 ckeditor.fields.RichTextField(blank=True,
                                               default='',
                                               verbose_name='En Información')),
                ('prioridad',
                 cms.models.IntegerRangeField(blank=True,
                                              null=True,
                                              verbose_name='Prioridad')),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Fecha Creación')),
                ('updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Fecha Actualización')),
                ('lugar',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='promo_place',
                                   to='cms.Lugar',
                                   verbose_name='Lugar')),
            ],
            options={
                'verbose_name': 'Promo',
                'verbose_name_plural': 'Promos',
            },
        ),
        migrations.CreateModel(
            name='Precio',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('estado',
                 models.CharField(choices=[('Activo', 'Activo'),
                                           ('Inactivo', 'Inactivo')],
                                  default=1,
                                  max_length=20,
                                  verbose_name='Estado')),
                ('titulo',
                 models.CharField(max_length=100, verbose_name='Título')),
                ('en_titulo',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=100,
                                  verbose_name='En Título')),
                ('subtitulo',
                 models.CharField(blank=True,
                                  max_length=100,
                                  verbose_name='Subtítulo')),
                ('en_subtitulo',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=100,
                                  verbose_name='En Subtítulo')),
                ('informacion',
                 ckeditor.fields.RichTextField(blank=True,
                                               verbose_name='Información')),
                ('en_informacion',
                 ckeditor.fields.RichTextField(blank=True,
                                               default='',
                                               verbose_name='En Información')),
                ('prioridad',
                 cms.models.IntegerRangeField(blank=True,
                                              null=True,
                                              verbose_name='Prioridad')),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Fecha Creación')),
                ('updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Fecha Actualización')),
                ('cantidad',
                 models.DecimalField(decimal_places=2,
                                     default=0,
                                     max_digits=6,
                                     verbose_name='Cantidad')),
                ('lugar',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='price_place',
                                   to='cms.Lugar',
                                   verbose_name='Lugar')),
            ],
            options={
                'verbose_name': 'Precio',
                'verbose_name_plural': 'Precios',
            },
        ),
        migrations.CreateModel(
            name='PeriodoHorario',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('dia',
                 models.CharField(blank=True,
                                  choices=[('Lunes', 'Lunes'),
                                           ('Martes', 'Martes'),
                                           ('Miercoles', 'Miercoles'),
                                           ('Jueves', 'Jueves'),
                                           ('Viernes', 'Viernes'),
                                           ('Sábado', 'Sábado'),
                                           ('Domingo', 'Domingo')],
                                  default='Lunes',
                                  max_length=9,
                                  verbose_name='Día')),
                ('inicio',
                 models.TimeField(default='09:00', verbose_name='Apertura')),
                ('fin', models.TimeField(default='20:00',
                                         verbose_name='Cierre')),
                ('horario',
                 models.ForeignKey(blank=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='schedule_periods',
                                   to='cms.Horario',
                                   verbose_name='Horario')),
            ],
            options={
                'verbose_name': 'Periodo Horario',
                'verbose_name_plural': 'Periodos Horario',
            },
        ),
        migrations.CreateModel(
            name='Imagen',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('titulo',
                 models.CharField(max_length=100, verbose_name='Título')),
                ('header',
                 models.BooleanField(default=False, verbose_name='Principal')),
                ('imagen',
                 models.ImageField(default='photos/default.jpg',
                                   upload_to='photos',
                                   verbose_name='Imagen')),
                ('object_id',
                 models.PositiveIntegerField(default=1,
                                             verbose_name='Objeto')),
                ('content_type',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='content_type_image',
                                   to='contenttypes.ContentType',
                                   verbose_name='Tipo')),
            ],
            options={
                'verbose_name': 'Imagen',
                'verbose_name_plural': 'Imagenes',
            },
        ),
        migrations.AddField(
            model_name='horario',
            name='lugar',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='schedule_place',
                to='cms.Lugar',
                verbose_name='Lugar'),
        ),
    ]
コード例 #13
0
class Migration(migrations.Migration):

    dependencies = [
        ('cms', '0011_auto_20160720_1251'),
    ]

    operations = [
        migrations.CreateModel(
            name='Video',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('content_type', models.CharField(max_length=190)),
                ('object_id', models.PositiveIntegerField()),
                ('label', models.CharField(max_length=100)),
                ('source',
                 models.FileField(upload_to='cms/%Y_%m',
                                  validators=[cms.models.validate_video_type
                                              ])),
                ('poster', models.ImageField(blank=True,
                                             upload_to='cms/%Y_%m')),
                ('description', models.CharField(blank=True, max_length=255)),
                ('loop', models.BooleanField(default=False)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AlterField(
            model_name='block',
            name='language',
            field=models.CharField(choices=[
                ('af', 'Afrikaans'), ('ar', 'Arabic'), ('ast', 'Asturian'),
                ('az', 'Azerbaijani'),
                ('bg', 'Bulgarian'), ('be', 'Belarusian'), ('bn', 'Bengali'),
                ('br', 'Breton'), ('bs', 'Bosnian'), ('ca', 'Catalan'),
                ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'),
                ('de', 'German'), ('dsb', 'Lower Sorbian'), ('el', 'Greek'),
                ('en', 'English'), ('en-au', 'Australian English'),
                ('en-gb', 'British English'), ('eo', 'Esperanto'),
                ('es', 'Spanish'), ('es-ar', 'Argentinian Spanish'),
                ('es-co', 'Colombian Spanish'), ('es-mx', 'Mexican Spanish'),
                ('es-ni', 'Nicaraguan Spanish'), ('es-ve',
                                                  'Venezuelan Spanish'),
                ('et', 'Estonian'), ('eu', 'Basque'), ('fa', 'Persian'),
                ('fi', 'Finnish'), ('fr', 'French'), ('fy', 'Frisian'),
                ('ga', 'Irish'), ('gd', 'Scottish Gaelic'), ('gl', 'Galician'),
                ('he', 'Hebrew'), ('hi', 'Hindi'), ('hr', 'Croatian'),
                ('hsb', 'Upper Sorbian'), ('hu', 'Hungarian'),
                ('ia', 'Interlingua'), ('id', 'Indonesian'), ('io', 'Ido'),
                ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'),
                ('ka', 'Georgian'), ('kab', 'Kabyle'), ('kk', 'Kazakh'),
                ('km', 'Khmer'), ('kn', 'Kannada'), ('ko', 'Korean'),
                ('lb', 'Luxembourgish'), ('lt', 'Lithuanian'),
                ('lv', 'Latvian'), ('mk', 'Macedonian'), ('ml', 'Malayalam'),
                ('mn', 'Mongolian'), ('mr', 'Marathi'), ('my', 'Burmese'),
                ('nb', 'Norwegian Bokmål'), ('ne', 'Nepali'), ('nl', 'Dutch'),
                ('nn', 'Norwegian Nynorsk'), ('os', 'Ossetic'),
                ('pa', 'Punjabi'), ('pl', 'Polish'), ('pt', 'Portuguese'),
                ('pt-br', 'Brazilian Portuguese'), ('ro', 'Romanian'),
                ('ru', 'Russian'), ('sk', 'Slovak'), ('sl', 'Slovenian'),
                ('sq', 'Albanian'), ('sr', 'Serbian'),
                ('sr-latn', 'Serbian Latin'), ('sv', 'Swedish'),
                ('sw', 'Swahili'), ('ta', 'Tamil'), ('te', 'Telugu'),
                ('th', 'Thai'), ('tr', 'Turkish'), ('tt', 'Tatar'),
                ('udm', 'Udmurt'), ('uk', 'Ukrainian'), ('ur', 'Urdu'),
                ('vi', 'Vietnamese'), ('zh-hans', 'Simplified Chinese'),
                ('zh-hant', 'Traditional Chinese')
            ],
                                   default='en-us',
                                   max_length=10),
        ),
        migrations.AlterField(
            model_name='image',
            name='file',
            field=models.ImageField(blank=True, upload_to='cms/%Y_%m'),
        ),
        migrations.AlterUniqueTogether(
            name='video',
            unique_together={('content_type', 'object_id', 'label')},
        ),
    ]
コード例 #14
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="MediaResource",
            fields=[
                (
                    "caption",
                    models.TextField(
                        blank=True,
                        help_text="A caption for the resource.",
                        verbose_name="caption",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        auto_now_add=True,
                        help_text="The time that the resource was created at.",
                        verbose_name="creation time",
                    ),
                ),
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        help_text="A unique identifier for the media resource.",
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "is_listed",
                    models.BooleanField(
                        default=True,
                        help_text="Designates if the resource is listed publicly. Unlisted images can still be accessed by anyone with the ID of the resource.",
                        verbose_name="listed",
                    ),
                ),
                (
                    "image",
                    models.ImageField(
                        blank=True,
                        help_text="The image that the media resource encapsulates.",
                        upload_to=cms.models.get_media_resource_image_path,
                        verbose_name="image",
                    ),
                ),
                (
                    "title",
                    models.CharField(
                        blank=True,
                        help_text="A title for the resource.",
                        max_length=100,
                        verbose_name="title",
                    ),
                ),
                (
                    "youtube_id",
                    models.CharField(
                        blank=True,
                        help_text="The ID of the YouTube video the resource encapsulates.",
                        max_length=32,
                        verbose_name="YouTube ID",
                    ),
                ),
            ],
            options={
                "verbose_name": "media resource",
                "verbose_name_plural": "media resources",
                "ordering": ("created",),
            },
        )
    ]
コード例 #15
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('profile_picture',
                 models.ImageField(blank=True, upload_to='profile_picture')),
                ('email',
                 models.EmailField(max_length=254,
                                   unique=True,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('twitter',
                 models.CharField(blank=True,
                                  max_length=50,
                                  verbose_name='Twitter')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
                'swappable': 'AUTH_USER_MODEL',
            },
            managers=[
                ('objects', cms.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('picture', models.ImageField(upload_to='profile_picture')),
                ('title', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('message', models.TextField(max_length=3000)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('created_by',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='user',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('picture', models.ImageField(upload_to='profile_picture')),
            ],
            options={
                'db_table': 'profile',
            },
        ),
        migrations.CreateModel(
            name='Thread',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('subject', models.CharField(max_length=100)),
                ('code', models.CharField(max_length=100, null=True)),
                ('faculty',
                 models.CharField(choices=[('前期教養学部', '前期教養学部'),
                                           ('後期教養学部', '後期教養学部'),
                                           ('法学部', '法学部'), ('経済学部', '経済学部'),
                                           ('文学部', '文学部'), ('教育学部', '教育学部'),
                                           ('理学部', '理学部'), ('工学部', '工学部'),
                                           ('農学部', '農学部'), ('薬学部', '薬学部'),
                                           ('医学部', '医学部')],
                                  max_length=20,
                                  null=True)),
            ],
        ),
        migrations.AddField(
            model_name='post',
            name='thread',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='threads',
                to='cms.Thread'),
        ),
        migrations.AddField(
            model_name='user',
            name='favorite_thread',
            field=models.ManyToManyField(blank=True, to='cms.Thread'),
        ),
        migrations.AddField(
            model_name='user',
            name='groups',
            field=models.ManyToManyField(
                blank=True,
                help_text=
                'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                related_name='user_set',
                related_query_name='user',
                to='auth.Group',
                verbose_name='groups'),
        ),
        migrations.AddField(
            model_name='user',
            name='user_permissions',
            field=models.ManyToManyField(
                blank=True,
                help_text='Specific permissions for this user.',
                related_name='user_set',
                related_query_name='user',
                to='auth.Permission',
                verbose_name='user permissions'),
        ),
    ]
コード例 #16
0
ファイル: 0001_initial.py プロジェクト: rtts/bps
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Page',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', cms.models.VarCharField(verbose_name='page')),
                ('slug',
                 models.SlugField(blank=True, unique=True,
                                  verbose_name='slug')),
                ('number',
                 models.PositiveIntegerField(blank=True,
                                             verbose_name='number')),
                ('menu',
                 models.BooleanField(default=True,
                                     verbose_name='visible in menu')),
            ],
            options={
                'verbose_name': 'Page',
                'verbose_name_plural': 'Pages',
                'ordering': ['number'],
                'abstract': False,
            },
            bases=(cms.models.Numbered, models.Model),
        ),
        migrations.CreateModel(
            name='Section',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', cms.models.VarCharField(verbose_name='section')),
                ('type', cms.models.VarCharField(verbose_name='type')),
                ('number',
                 models.PositiveIntegerField(blank=True,
                                             verbose_name='number')),
                ('content', models.TextField(blank=True,
                                             verbose_name='content')),
                ('image',
                 models.ImageField(blank=True,
                                   upload_to='',
                                   verbose_name='image')),
                ('video',
                 embed_video.fields.EmbedVideoField(
                     blank=True,
                     help_text='Paste a YouTube, Vimeo, or SoundCloud link',
                     verbose_name='video')),
                ('href',
                 cms.models.VarCharField(blank=True, verbose_name='link')),
                ('page',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   related_name='sections',
                                   to='pages.Page')),
            ],
            options={
                'verbose_name': 'section',
                'verbose_name_plural': 'sections',
                'ordering': ['number'],
                'abstract': False,
            },
            bases=(cms.models.Numbered, models.Model),
        ),
        migrations.CreateModel(
            name='SectionImage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image', models.ImageField(upload_to='',
                                            verbose_name='Image')),
                ('section',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='images',
                                   to='pages.Section')),
            ],
            options={
                'ordering': ['pk'],
            },
        ),
    ]