示例#1
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(default='', max_length=10)),
                ('product_img_0', models.ImageField(default='image/none/noimage.jpg', upload_to=apps.product.models.user_directory_path)),
                ('product_img_1', models.ImageField(default='image/none/noimage.jpg', upload_to=apps.product.models.user_directory_path)),
                ('product_img_2', models.ImageField(default='image/none/noimage.jpg', upload_to=apps.product.models.user_directory_path)),
                ('product_img_3', models.ImageField(default='image/none/noimage.jpg', upload_to=apps.product.models.user_directory_path)),
                ('area', models.IntegerField(default=0)),
                ('price', models.IntegerField(default=0)),
                ('discount', models.IntegerField(default=0)),
                ('unit', models.CharField(default='', max_length=5)),
                ('date', models.DateTimeField(blank=True, default=django.utils.timezone.now, editable=False)),
                ('post_type', models.IntegerField(choices=[(0, 'Buy'), (1, 'Sell')], default=0)),
                ('location', django.contrib.postgres.fields.jsonb.JSONField(blank=True, default={})),
                ('description', models.TextField(default='')),
                ('verify', models.BooleanField(default=False)),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='user.User')),
            ],
        ),
    ]
示例#2
0
class Migration(migrations.Migration):

    dependencies = [
        ('product', '0004_auto_20210517_2236'),
    ]

    operations = [
        migrations.AlterField(
            model_name='product',
            name='identifier',
            field=models.CharField(blank=True,
                                   default='7658424529',
                                   max_length=50,
                                   null=True),
        ),
        migrations.CreateModel(
            name='Banner',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=50)),
                ('description', models.TextField(max_length=500)),
                ('image',
                 models.ImageField(
                     upload_to=apps.product.models.banner_image_directory_path)
                 ),
                ('status', models.BooleanField(default=False)),
                ('created', models.DateTimeField(auto_now=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('product',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='product.product')),
            ],
            options={
                'verbose_name': 'Banner',
                'verbose_name_plural': 'Banners',
            },
        ),
    ]
示例#3
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Price',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.DecimalField(decimal_places=2, max_digits=5)),
                ('created_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='name', unique=True)),
                ('thumb', models.ImageField(blank=True, upload_to=apps.product.models.product_directory_path)),
            ],
        ),
        migrations.CreateModel(
            name='Ticket',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('price', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='product.Price')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='product.Product')),
            ],
        ),
        migrations.AddField(
            model_name='price',
            name='product',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='product.Product'),
        ),
    ]
示例#4
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name_en',
                 models.CharField(blank=True,
                                  max_length=255,
                                  verbose_name='name_en')),
                ('name_cn',
                 models.CharField(blank=True,
                                  max_length=255,
                                  verbose_name='name_cn')),
                ('pinyin',
                 models.CharField(blank=True,
                                  max_length=255,
                                  verbose_name='pinyin')),
                ('pic',
                 stdimage.models.StdImageField(blank=True,
                                               null=True,
                                               upload_to='product',
                                               verbose_name='picture')),
                ('alias',
                 models.CharField(blank=True,
                                  max_length=255,
                                  verbose_name='alias')),
                ('category',
                 models.CharField(blank=True,
                                  choices=[('乳液/面霜', '乳液/面霜'), ('卸妆', '卸妆'),
                                           ('去角质', '去角质'), ('化妆水', '化妆水'),
                                           ('洁面', '洁面'), ('精华', '精华'),
                                           ('防晒', '防晒'), ('面膜', '面膜')],
                                  max_length=64)),
                ('description',
                 models.TextField(blank=True, verbose_name='description')),
                ('created_at',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('brand',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='brand.Brand')),
            ],
            bases=(core.django.models.ResizeUploadedImageModelMixin,
                   core.django.models.PinYinFieldModelMixin, models.Model),
        ),
        migrations.CreateModel(
            name='ProductAnalysis',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('oily_type',
                 models.CharField(blank=True,
                                  choices=[('1', '重度油性'), ('2', '轻度油性'),
                                           ('3', '轻度干性'), ('4', '重度干性')],
                                  max_length=64,
                                  verbose_name='油性or干性')),
                ('sensitive_type',
                 models.CharField(blank=True,
                                  choices=[('5', '重度敏感性'), ('6', '轻度敏感性'),
                                           ('7', '轻度耐受性'), ('8', '耐受性')],
                                  max_length=64,
                                  verbose_name='敏感or耐受')),
                ('pigment_type',
                 models.CharField(blank=True,
                                  choices=[('9', '色素性皮肤'), ('10', '非色素性皮肤')],
                                  max_length=64,
                                  verbose_name='色素or非色素')),
                ('loose_type',
                 models.CharField(blank=True,
                                  choices=[('11', '非紧致性皮肤'), ('12', '紧致性皮肤')],
                                  max_length=64,
                                  verbose_name='易皱or紧致')),
                ('analysis',
                 models.TextField(blank=True,
                                  max_length=64,
                                  verbose_name='对应阐述')),
                ('product',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='product.Product')),
            ],
        ),
        migrations.CreateModel(
            name='ProductIngredient',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(blank=True,
                                  max_length=255,
                                  verbose_name='name')),
                ('is_safe', models.BooleanField(verbose_name='安全风险')),
                ('is_live', models.BooleanField(verbose_name='活性成分')),
                ('is_pox', models.BooleanField(verbose_name='致痘风险')),
                ('effect',
                 models.CharField(blank=True,
                                  max_length=255,
                                  verbose_name='使用目的')),
                ('description',
                 models.TextField(blank=True,
                                  max_length=512,
                                  verbose_name='描述')),
                ('product',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='product.Product')),
            ],
        ),
    ]
示例#5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20)),
                ('description', models.TextField(max_length=100)),
                ('status', models.BooleanField(default=False)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('lft', models.PositiveIntegerField(editable=False)),
                ('rght', models.PositiveIntegerField(editable=False)),
                ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
                ('level', models.PositiveIntegerField(editable=False)),
                ('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='children', to='product.category')),
            ],
            options={
                'verbose_name': 'Product category',
                'verbose_name_plural': 'Product category',
            },
        ),
        migrations.CreateModel(
            name='ProductCommandForm',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('field_name', models.CharField(max_length=255, verbose_name='Name')),
                ('field_label', models.CharField(blank=True, max_length=50, null=True, verbose_name='Label')),
                ('initial_values', models.CharField(blank=True, help_text='Put here the choices separated by a comma', max_length=50, null=True)),
                ('field_type', models.CharField(blank=True, choices=[('choices', 'Choix'), ('int', 'Integer'), ('archived', 'Archived - not available anymore')], max_length=50, null=True)),
            ],
            options={
                'verbose_name': 'Product form field',
                'verbose_name_plural': 'Product form fields',
            },
        ),
        migrations.CreateModel(
            name='TypeForm',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=50, null=True)),
                ('form', models.ManyToManyField(to='product.ProductCommandForm')),
            ],
            options={
                'verbose_name': 'Product form type',
                'verbose_name_plural': 'Product form type',
            },
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=50, null=True)),
                ('identifier', models.CharField(blank=True, default='8255383486', max_length=50, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('marque', models.CharField(blank=True, max_length=50, null=True)),
                ('price', models.DecimalField(decimal_places=2, default=0, help_text='Product price', max_digits=9)),
                ('image', models.ImageField(blank=True, null=True, upload_to=apps.product.models.product_image_directory_path)),
                ('status', models.BooleanField(default=False)),
                ('created', models.DateTimeField(auto_now=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='product.category')),
                ('type_form', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='product.typeform')),
            ],
            options={
                'verbose_name': 'Product',
                'verbose_name_plural': 'Products',
            },
        ),
    ]