class Migration(migrations.Migration):

    dependencies = [
        ('category', '0003_menu'),
    ]

    operations = [
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=120)),
                ('image', models.ImageField(blank=True, height_field='height_field', null=True, upload_to=category.models.uplaod_location, width_field='width_field')),
                ('sell_price', models.DecimalField(decimal_places=2, default=0, max_digits=8)),
                ('descriptions', models.TextField()),
                ('height_field', models.IntegerField(default=0)),
                ('width_field', models.IntegerField(default=0)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='category.Category')),
                ('menu', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='category.Menu')),
            ],
            options={
                'db_table': 'products',
            },
        ),
    ]
Exemplo n.º 2
0
class Migration(migrations.Migration):

    dependencies = [
        ('category', '0002_auto_20170804_0050'),
    ]

    operations = [
        migrations.CreateModel(
            name='Menu',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=120)),
                ('image',
                 models.ImageField(blank=True,
                                   height_field='height_field',
                                   null=True,
                                   upload_to=category.models.uplaod_location,
                                   width_field='width_field')),
                ('descriptions', models.TextField()),
                ('height_field', models.IntegerField(default=0)),
                ('width_field', models.IntegerField(default=0)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'db_table': 'menus',
            },
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('category', '0002_category_image'),
    ]

    operations = [
        migrations.CreateModel(
            name='SubCategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='Unique one', max_length=200, unique=True)),
                ('image', models.ImageField(blank=True, null=True, upload_to=category.models.upload_filename_ext)),
                ('update', models.DateTimeField(auto_now=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('active', models.BooleanField(default=True)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='category.Category')),
            ],
        ),
    ]
Exemplo n.º 4
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=100)),
                ('title', models.CharField(max_length=100)),
                ('image',
                 models.ImageField(
                     null=True,
                     upload_to=category.models.Category.get_upload_path)),
                ('description', models.TextField(blank=True, null=True)),
                ('user_type',
                 models.IntegerField(choices=[(1, 'Vendor'), (2, 'Supplier')],
                                     default=1)),
                ('display_home',
                 models.IntegerField(choices=[(0, 'No'), (1, 'Yes')],
                                     default=0)),
                ('display_menu',
                 models.IntegerField(choices=[(0, 'No'), (1, 'Yes')],
                                     default=0)),
                ('status',
                 models.IntegerField(choices=[(0, 'Inactive'), (1, 'Active')],
                                     default=0)),
                ('views', models.IntegerField(default=0)),
                ('created_at', models.DateTimeField(blank=True, null=True)),
                ('created_user', models.IntegerField(blank=True, null=True)),
                ('updated_at', models.DateTimeField(blank=True, null=True)),
                ('updated_user', models.IntegerField(blank=True, null=True)),
            ],
            options={
                'verbose_name': 'category',
                'verbose_name_plural': 'categories',
                'db_table': 'wp_category',
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='SubCategory',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('title', models.CharField(max_length=100)),
                ('image',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to='subcategory/images/')),
                ('description', models.TextField(blank=True, null=True)),
                ('user_type',
                 models.IntegerField(blank=True,
                                     choices=[(1, 'Vendor'), (2, 'Supplier')],
                                     null=True)),
                ('display_home',
                 models.IntegerField(choices=[(0, 'No'), (1, 'Yes')],
                                     default=0)),
                ('display_menu',
                 models.IntegerField(choices=[(0, 'No'), (1, 'Yes')],
                                     default=0)),
                ('status',
                 models.IntegerField(choices=[(0, 'Inactive'), (1, 'Active')],
                                     default=0)),
                ('views', models.IntegerField(default=0)),
                ('created_at', models.DateTimeField(blank=True, null=True)),
                ('created_user', models.IntegerField(blank=True, null=True)),
                ('updated_at', models.DateTimeField(blank=True, null=True)),
                ('updated_user', models.IntegerField(blank=True, null=True)),
                ('cat_id',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='category.Category')),
            ],
            options={
                'db_table': 'wp_subcategory',
            },
        ),
    ]
Exemplo n.º 5
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.RemoveField(
            model_name='category',
            name='category_type',
        ),
        migrations.RemoveField(
            model_name='category',
            name='created_by',
        ),
        migrations.RemoveField(
            model_name='category',
            name='modified_at',
        ),
        migrations.RemoveField(
            model_name='category',
            name='modified_by',
        ),
        migrations.AddField(
            model_name='category',
            name='descriptions',
            field=models.TextField(null=True),
        ),
        migrations.AddField(
            model_name='category',
            name='height_field',
            field=models.IntegerField(default=0),
        ),
        migrations.AddField(
            model_name='category',
            name='image',
            field=models.ImageField(blank=True,
                                    height_field='height_field',
                                    null=True,
                                    upload_to=category.models.uplaod_location,
                                    width_field='width_field'),
        ),
        migrations.AddField(
            model_name='category',
            name='updated_at',
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AddField(
            model_name='category',
            name='width_field',
            field=models.IntegerField(default=0),
        ),
        migrations.AlterField(
            model_name='category',
            name='created_at',
            field=models.DateTimeField(auto_now_add=True),
        ),
        migrations.AlterField(
            model_name='category',
            name='name',
            field=models.CharField(max_length=120),
        ),
        migrations.AlterModelTable(
            name='category',
            table='categories',
        ),
    ]