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

    initial = True

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

    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=254,
                                  verbose_name='Product Name')),
                ('description',
                 models.CharField(max_length=254,
                                  verbose_name='Product Description')),
                ('image',
                 models.ImageField(
                     upload_to=apps.products.models.random_filename,
                     verbose_name='Image')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='User')),
            ],
        ),
    ]
Пример #2
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=120)),
                ('slug', models.SlugField(blank=True, unique=True)),
                ('description', models.TextField()),
                ('price',
                 models.DecimalField(decimal_places=2,
                                     default=39.99,
                                     max_digits=20)),
                ('image',
                 models.ImageField(
                     blank=True,
                     null=True,
                     upload_to=apps.products.models.upload_image_path)),
                ('featured', models.BooleanField(default=False)),
                ('active', models.BooleanField(default=True)),
            ],
        ),
    ]
Пример #3
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('category', '0001_initial'),
        ('stocks', '0001_initial'),
        ('vendors', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=120)),
                ('description', models.TextField(blank=True, null=True)),
                ('price', models.DecimalField(decimal_places=2, default=39.99, max_digits=20)),
                ('image', models.ImageField(blank=True, null=True, upload_to=apps.products.models.upload_image_path)),
                ('featured', models.BooleanField(default=False)),
                ('active', models.BooleanField(default=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now_add=True)),
                ('is_deleted', models.BooleanField(default=False)),
                ('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='category.Categories')),
                ('stock', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='stocks.Stock')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('vendor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='vendors.Vendor')),
            ],
        ),
    ]
Пример #4
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Categories',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('category', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Products',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('product_name', models.CharField(max_length=200)),
                ('description', models.TextField(blank=True, null=True)),
                ('price', models.DecimalField(decimal_places=2, max_digits=10)),
                ('availability', models.CharField(max_length=100)),
                ('exp_date', models.DateTimeField()),
                ('category', models.ManyToManyField(to='products.Categories')),
            ],
        ),
        migrations.CreateModel(
            name='Images',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to=apps.products.models.get_image_filename, verbose_name='Image')),
                ('product', models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='products.Products')),
            ],
        ),
    ]
Пример #5
0
class Migration(migrations.Migration):

    dependencies = [
        ('products', '0004_auto_20200722_2041'),
        ('inventories', '0006_auto_20200818_2254'),
    ]

    operations = [
        migrations.CreateModel(
            name='Purchase',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='PurchaseItem',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('quantity',
                 models.DecimalField(decimal_places=5,
                                     max_digits=12,
                                     null=True)),
                ('unit',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='products.Unit')),
                ('product',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='products.Product')),
                ('purchase',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='items',
                                   to='inventories.Purchase')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
Пример #6
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=255,
                                  unique=True,
                                  verbose_name='Название')),
                ('slug', models.CharField(max_length=128, verbose_name='Код')),
                ('description',
                 models.TextField(blank=True,
                                  null=True,
                                  verbose_name='Описание')),
                ('is_active',
                 models.BooleanField(blank=True,
                                     default=True,
                                     verbose_name='Активированно')),
                ('image',
                 models.ImageField(
                     blank=True,
                     null=True,
                     upload_to=apps.products.models.upload_category_location,
                     verbose_name='Фото')),
                ('extra',
                 django.contrib.postgres.fields.jsonb.JSONField(
                     blank=True,
                     default=dict,
                     null=True,
                     verbose_name='Дополнительно')),
            ],
            options={
                'verbose_name_plural': 'Категории',
                'verbose_name': 'Категория',
            },
        ),
        migrations.CreateModel(
            name='CollectionImage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('src',
                 models.ImageField(
                     blank=True,
                     null=True,
                     upload_to=apps.products.models.upload_collection_location)
                 ),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('extra',
                 django.contrib.postgres.fields.jsonb.JSONField(blank=True,
                                                                default=dict,
                                                                null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Manufacturer',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=255,
                                  unique=True,
                                  verbose_name='Название')),
                ('slug',
                 models.CharField(blank=True,
                                  max_length=128,
                                  null=True,
                                  verbose_name='slug')),
                ('is_active',
                 models.BooleanField(blank=True,
                                     default=True,
                                     verbose_name='Активированно')),
                ('extra',
                 django.contrib.postgres.fields.jsonb.JSONField(
                     blank=True,
                     default=dict,
                     null=True,
                     verbose_name='Дополнительно')),
            ],
            options={
                'verbose_name_plural': 'Производители',
                'verbose_name': 'Производитель',
            },
        ),
        migrations.CreateModel(
            name='NFacet',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=255,
                                  unique=True,
                                  verbose_name='Название')),
                ('slug',
                 models.CharField(max_length=128,
                                  unique=True,
                                  verbose_name='Код')),
                ('suffix',
                 models.CharField(blank=True,
                                  max_length=128,
                                  null=True,
                                  verbose_name='Суффикс')),
                ('is_active',
                 models.BooleanField(blank=True,
                                     default=True,
                                     verbose_name='Активированно')),
                ('extra',
                 django.contrib.postgres.fields.jsonb.JSONField(
                     blank=True,
                     default=dict,
                     null=True,
                     verbose_name='Дополнительно')),
            ],
            options={
                'verbose_name_plural': 'Числовые аттрибуты',
                'verbose_name': 'Числовой аттрибут',
            },
        ),
        migrations.CreateModel(
            name='NFacetValue',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('value', models.DecimalField(decimal_places=5,
                                              max_digits=15)),
                ('extra',
                 django.contrib.postgres.fields.jsonb.JSONField(
                     blank=True,
                     default=dict,
                     null=True,
                     verbose_name='Дополнительно')),
                ('facet',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='values',
                                   to='products.NFacet')),
            ],
            options={
                'verbose_name_plural': 'Числовой аттрибуты',
                'verbose_name': 'Числовой аттрибут',
            },
        ),
        migrations.CreateModel(
            name='ProductInfo',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=255, verbose_name='Название')),
                ('description',
                 models.TextField(blank=True,
                                  null=True,
                                  verbose_name='Описание')),
                ('extra',
                 django.contrib.postgres.fields.jsonb.JSONField(
                     blank=True,
                     default=dict,
                     null=True,
                     verbose_name='Дополнительно')),
                ('created_at',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Созданно')),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='menu',
                                   to='products.Category',
                                   verbose_name='Категория')),
                ('manufacturer',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='product_info',
                                   to='products.Manufacturer',
                                   verbose_name='Производитель')),
                ('nfacets',
                 models.ManyToManyField(blank=True,
                                        to='products.NFacetValue',
                                        verbose_name='парамеры')),
            ],
            options={
                'verbose_name_plural': 'Описание товаров',
                'verbose_name': 'Описание товара',
            },
        ),
        migrations.CreateModel(
            name='SFacet',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=255,
                                  unique=True,
                                  verbose_name='Название')),
                ('slug',
                 models.CharField(max_length=128,
                                  unique=True,
                                  verbose_name='Код')),
                ('is_active',
                 models.BooleanField(blank=True,
                                     default=True,
                                     verbose_name='Активированно')),
                ('extra',
                 django.contrib.postgres.fields.jsonb.JSONField(
                     blank=True,
                     default=dict,
                     null=True,
                     verbose_name='Дополнительно')),
            ],
            options={
                'verbose_name_plural': 'Строковые аттрибуты',
                'verbose_name': 'Строковый аттрибут',
            },
        ),
        migrations.CreateModel(
            name='Tags',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=255,
                                  unique=True,
                                  verbose_name='Название')),
                ('is_active',
                 models.BooleanField(blank=True,
                                     default=True,
                                     verbose_name='Активированно')),
                ('extra',
                 django.contrib.postgres.fields.jsonb.JSONField(
                     blank=True,
                     default=dict,
                     null=True,
                     verbose_name='Дополнительно')),
            ],
            options={
                'verbose_name_plural': 'Метки',
                'verbose_name': 'Метка',
            },
        ),
        migrations.CreateModel(
            name='SFacetValue',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=255, verbose_name='Значение')),
                ('is_active',
                 models.BooleanField(blank=True,
                                     default=True,
                                     verbose_name='Активированно')),
                ('extra',
                 django.contrib.postgres.fields.jsonb.JSONField(
                     blank=True,
                     default=dict,
                     null=True,
                     verbose_name='Дополнительно')),
                ('facet',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='values',
                                   to='products.SFacet')),
            ],
            options={
                'verbose_name_plural': 'Значения аттрибутов',
                'verbose_name': 'Значение аттрибута',
                'unique_together': {('facet', 'name')},
            },
        ),
        migrations.CreateModel(
            name='ProductInstance',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('sku', models.BigIntegerField(verbose_name='Артикул')),
                ('measure',
                 models.IntegerField(verbose_name='Количество в миллилитрах')),
                ('price',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     max_digits=10,
                                     null=True,
                                     verbose_name='Цена')),
                ('base_price',
                 models.DecimalField(decimal_places=2,
                                     max_digits=10,
                                     verbose_name='Базовая Цена')),
                ('stock_balance',
                 models.IntegerField(verbose_name='Остаток на складе')),
                ('package_amount',
                 models.IntegerField(verbose_name='Количество в упаковке')),
                ('capacity_type',
                 models.CharField(blank=True,
                                  max_length=255,
                                  null=True,
                                  verbose_name='Тип ёмкости')),
                ('sales',
                 django.contrib.postgres.fields.jsonb.JSONField(blank=True,
                                                                default=list,
                                                                null=True)),
                ('collections',
                 django.contrib.postgres.fields.jsonb.JSONField(blank=True,
                                                                default=list,
                                                                null=True)),
                ('extra',
                 django.contrib.postgres.fields.jsonb.JSONField(
                     blank=True,
                     default=dict,
                     null=True,
                     verbose_name='Дополнительно')),
                ('created_at',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Созданно')),
                ('status',
                 models.CharField(choices=[('active', 'Активно'),
                                           ('draft', 'Черновик'),
                                           ('archive', 'Архив')],
                                  default='draft',
                                  max_length=128)),
                ('product_info',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='instances',
                                   to='products.ProductInfo',
                                   verbose_name='Инфо')),
            ],
            options={
                'verbose_name_plural': 'Товары',
                'verbose_name': 'Товар',
            },
        ),
        migrations.AddField(
            model_name='productinfo',
            name='sfacets',
            field=models.ManyToManyField(blank=True,
                                         to='products.SFacetValue',
                                         verbose_name='парамеры'),
        ),
        migrations.AddField(
            model_name='productinfo',
            name='tags',
            field=models.ManyToManyField(blank=True,
                                         to='products.Tags',
                                         verbose_name='Тэги'),
        ),
        migrations.CreateModel(
            name='ProductImage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('is_active',
                 models.BooleanField(default=True,
                                     verbose_name='Активированно')),
                ('is_main',
                 models.BooleanField(blank=True,
                                     default=False,
                                     verbose_name='Главная')),
                ('src',
                 models.ImageField(
                     blank=True,
                     null=True,
                     upload_to=apps.products.models.upload_location,
                     verbose_name='Фото')),
                ('created_at',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Созданно')),
                ('extra',
                 django.contrib.postgres.fields.jsonb.JSONField(
                     blank=True,
                     default=dict,
                     null=True,
                     verbose_name='Дополнительно')),
                ('instance',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='images',
                                   to='products.ProductInstance',
                                   verbose_name='Товар')),
            ],
        ),
        migrations.CreateModel(
            name='Collection',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('slug', models.CharField(blank=True, max_length=255)),
                ('description', models.TextField(blank=True, null=True)),
                ('is_active', models.BooleanField(blank=True, default=True)),
                ('is_public', models.BooleanField(blank=True, default=False)),
                ('on_home', models.BooleanField(blank=True, default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('extra',
                 django.contrib.postgres.fields.jsonb.JSONField(blank=True,
                                                                default=dict,
                                                                null=True)),
                ('image',
                 models.OneToOneField(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='products.CollectionImage')),
                ('products',
                 models.ManyToManyField(blank=True,
                                        related_name='collections_set',
                                        to='products.ProductInstance')),
            ],
        ),
    ]
Пример #7
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('code',
                 models.CharField(max_length=10,
                                  null=True,
                                  unique=True,
                                  verbose_name='Código')),
                ('description',
                 models.CharField(max_length=255,
                                  null=True,
                                  verbose_name='Descripción del producto')),
                ('unit',
                 models.CharField(max_length=4,
                                  null=True,
                                  verbose_name='Unidad')),
                ('base_code',
                 models.CharField(blank=True,
                                  default='000000',
                                  max_length=6,
                                  null=True,
                                  verbose_name='Código Base')),
                ('barcode',
                 models.CharField(blank=True,
                                  max_length=255,
                                  null=True,
                                  verbose_name='Código de Barras')),
                ('internal_barcode',
                 models.CharField(blank=True,
                                  max_length=255,
                                  null=True,
                                  verbose_name='Código de Barras Interno')),
                ('supplier_code',
                 models.CharField(blank=True,
                                  max_length=255,
                                  null=True,
                                  verbose_name='Código del proveedor')),
                ('model',
                 models.CharField(blank=True,
                                  max_length=255,
                                  null=True,
                                  verbose_name='Modelos')),
                ('part_number',
                 models.CharField(blank=True,
                                  max_length=255,
                                  null=True,
                                  verbose_name='Número de parte')),
                ('brand_code',
                 models.CharField(blank=True,
                                  max_length=2,
                                  null=True,
                                  verbose_name='Código de Marca')),
                ('inventory_enabled',
                 models.BooleanField(default=False,
                                     verbose_name='Sistema de Inventarios?')),
                ('inventory_minimum',
                 models.FloatField(blank=True,
                                   default=0,
                                   null=True,
                                   verbose_name='Mínimo en inventario')),
                ('inventory_maximum',
                 models.FloatField(blank=True,
                                   default=0,
                                   null=True,
                                   verbose_name='Máximo en inventario')),
                ('inventory_negative',
                 models.BooleanField(default=False,
                                     verbose_name='Puede sobrefacturarse?')),
                ('cost',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     default=0,
                                     max_digits=10,
                                     null=True,
                                     verbose_name='Costo ₡')),
                ('utility',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     default=0,
                                     max_digits=5,
                                     null=True,
                                     verbose_name='Utilidad %')),
                ('utility2',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     default=0,
                                     max_digits=5,
                                     null=True,
                                     verbose_name='Utilidad %')),
                ('utility3',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     default=0,
                                     max_digits=5,
                                     null=True,
                                     verbose_name='Utilidad %')),
                ('price',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     default=0,
                                     max_digits=10,
                                     null=True,
                                     verbose_name='Precio sin Impuestos ₡')),
                ('price2',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     default=0,
                                     max_digits=10,
                                     null=True,
                                     verbose_name='Precio sin Impuestos ₡')),
                ('price3',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     default=0,
                                     max_digits=10,
                                     null=True,
                                     verbose_name='Precio sin Impuestos ₡')),
                ('ask_price',
                 models.BooleanField(default=False,
                                     verbose_name='Pide Precio al facturar?')),
                ('use_taxes',
                 models.BooleanField(default=False,
                                     verbose_name='Usa impuesto?')),
                ('taxes',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     default=0,
                                     max_digits=4,
                                     null=True,
                                     verbose_name='Impuestos %')),
                ('pred_discount',
                 models.DecimalField(
                     blank=True,
                     decimal_places=2,
                     default=0,
                     max_digits=4,
                     null=True,
                     verbose_name='Descuento Predeterminado %')),
                ('is_active',
                 models.BooleanField(default=True, verbose_name='Activo?')),
                ('consignment',
                 models.BooleanField(default=False,
                                     verbose_name='Es en consignación?')),
                ('generic',
                 models.BooleanField(default=False,
                                     verbose_name='Es Genérico?')),
                ('image',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=apps.products.models.url)),
            ],
            options={
                'verbose_name': 'Producto',
                'verbose_name_plural': 'Productos',
                'ordering': ['code'],
            },
        ),
        migrations.CreateModel(
            name='ProductDepartment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=255,
                                  verbose_name='Nombre de la Familia')),
                ('code',
                 models.CharField(max_length=2,
                                  verbose_name='Identificador de Familia')),
            ],
            options={
                'verbose_name': 'Familia',
                'verbose_name_plural': 'Productos - 1. Familias',
                'ordering': ['code'],
            },
        ),
        migrations.CreateModel(
            name='ProductSubDepartment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=255,
                                  verbose_name='Nombre de la Sub-Familia')),
                ('code',
                 models.CharField(
                     max_length=2,
                     verbose_name='Identificador de Sub-Familia')),
                ('department',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='products.ProductDepartment',
                     verbose_name='Familia')),
            ],
            options={
                'verbose_name': 'Sub-Familia',
                'verbose_name_plural': 'Productos - 2. Sub-Familias',
                'ordering': ['code'],
            },
        ),
        migrations.AddField(
            model_name='product',
            name='department',
            field=models.ForeignKey(
                default='',
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='products.ProductDepartment',
                verbose_name='Familia'),
        ),
        migrations.AddField(
            model_name='product',
            name='subdepartment',
            field=models.ForeignKey(
                default='',
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='products.ProductSubDepartment',
                verbose_name='Sub-Familia'),
        ),
        migrations.AlterUniqueTogether(
            name='productsubdepartment',
            unique_together={('department', 'code')},
        ),
    ]
Пример #8
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.RenameField(
            model_name='product',
            old_name='product_can_be_sold',
            new_name='active',
        ),
        migrations.RenameField(
            model_name='product',
            old_name='product_avaliable_count',
            new_name='avaliable_count',
        ),
        migrations.RenameField(
            model_name='product',
            old_name='product_created_updated',
            new_name='created',
        ),
        migrations.RenameField(
            model_name='product',
            old_name='product_detail',
            new_name='detail',
        ),
        migrations.RenameField(
            model_name='product',
            old_name='product_name',
            new_name='name',
        ),
        migrations.RenameField(
            model_name='product',
            old_name='product_price',
            new_name='price',
        ),
        migrations.RemoveField(
            model_name='product',
            name='Number_of_pages',
        ),
        migrations.RemoveField(
            model_name='product',
            name='Publication_date',
        ),
        migrations.AddField(
            model_name='product',
            name='attributes',
            field=django.contrib.postgres.fields.jsonb.JSONField(default=''),
        ),
        migrations.AddField(
            model_name='product',
            name='updated',
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.CreateModel(
            name='Gallery',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('photo',
                 models.ImageField(
                     blank=True,
                     null=True,
                     upload_to=apps.products.models.Gallery.get_file_path,
                     verbose_name='photo')),
                ('product',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='photos',
                     to='products.Product')),
            ],
        ),
        migrations.CreateModel(
            name='Complect',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('detail', models.TextField(default='')),
                ('discount',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     default=0,
                                     max_digits=2,
                                     null=True)),
                ('products', models.ManyToManyField(to='products.Product')),
            ],
        ),
    ]
Пример #9
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,
                                          verbose_name='naam')),
                ('slug',
                 models.SlugField(max_length=100,
                                  unique=True,
                                  verbose_name='slug')),
                ('image',
                 models.ImageField(
                     upload_to=apps.products.models.category_image_upload,
                     verbose_name='Afbeelding categorie')),
                ('cropping',
                 image_cropping.fields.ImageRatioField(
                     'image',
                     '300x260',
                     adapt_rotation=False,
                     allow_fullsize=False,
                     free_crop=False,
                     help_text=None,
                     hide_image_field=False,
                     size_warning=False,
                     verbose_name='afbeelding ratio')),
                ('featured',
                 models.BooleanField(default=False,
                                     verbose_name='voorpagina')),
            ],
            options={
                'verbose_name': 'Categorie',
                'verbose_name_plural': 'Categorieën',
            },
        ),
        migrations.CreateModel(
            name='Color',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100,
                                          verbose_name='naam')),
            ],
            options={
                'verbose_name': 'Kleur',
                'verbose_name_plural': 'Kleuren',
            },
        ),
        migrations.CreateModel(
            name='CustomerColor',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
            ],
            options={
                'verbose_name': 'Nummer kleur',
                'verbose_name_plural': 'Nummers kleur',
            },
        ),
        migrations.CreateModel(
            name='CustomerImage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
            ],
            options={
                'verbose_name': 'Nummer afbeelding',
                'verbose_name_plural': 'Nummers afbelding',
            },
        ),
        migrations.CreateModel(
            name='Price',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('price',
                 models.DecimalField(decimal_places=2,
                                     max_digits=7,
                                     verbose_name='prijs')),
                ('min_quantity',
                 models.IntegerField(validators=[
                     django.core.validators.MaxValueValidator(100000),
                     django.core.validators.MinValueValidator(1)
                 ],
                                     verbose_name='minimale hoeveelheid')),
                ('max_quantity',
                 models.IntegerField(validators=[
                     django.core.validators.MaxValueValidator(100000),
                     django.core.validators.MinValueValidator(1)
                 ],
                                     verbose_name='maximale hoeveelheid')),
            ],
            options={
                'verbose_name': 'Prijs',
                'verbose_name_plural': 'Prijzen',
            },
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=200,
                                          verbose_name='naam')),
                ('slug',
                 models.SlugField(max_length=200,
                                  unique=True,
                                  verbose_name='slug')),
                ('custom_image',
                 models.BooleanField(
                     default=False,
                     verbose_name='Klant kan een afbeelding kiezen')),
                ('custom_color',
                 models.BooleanField(
                     default=False,
                     verbose_name='Klant kan een kleur kiezen')),
                ('description',
                 ckeditor.fields.RichTextField(verbose_name='omschrijving')),
                ('extra_info',
                 ckeditor.fields.RichTextField(
                     verbose_name='extra informatie')),
                ('image',
                 models.ImageField(
                     upload_to=apps.products.models.product_image_upload,
                     verbose_name='image from Product Detail Page')),
                ('image_home',
                 models.ImageField(
                     upload_to=apps.products.models.product_image_upload,
                     verbose_name='image from Home Page')),
                ('image_category',
                 models.ImageField(
                     upload_to=apps.products.models.product_image_upload,
                     verbose_name='image from Category Page')),
                ('image_related',
                 models.ImageField(
                     upload_to=apps.products.models.product_image_upload,
                     verbose_name='image from Related Product list')),
                ('featured',
                 models.BooleanField(default=False,
                                     verbose_name='voorpagina')),
                ('min_order',
                 models.IntegerField(
                     default=1,
                     validators=[
                         django.core.validators.MaxValueValidator(10000),
                         django.core.validators.MinValueValidator(1)
                     ],
                     verbose_name='minimum aantal')),
                ('category',
                 models.ManyToManyField(blank=True,
                                        related_name='products',
                                        to='products.Category',
                                        verbose_name='categorieën')),
                ('color',
                 models.ManyToManyField(related_name='products',
                                        to='products.Color',
                                        verbose_name='kleur')),
                ('related',
                 models.ManyToManyField(
                     blank=True,
                     related_name='_product_related_+',
                     to='products.Product',
                     verbose_name='gerelateerde artikelen')),
            ],
            options={
                'verbose_name': 'Artikel',
                'verbose_name_plural': 'Artikelen',
            },
        ),
        migrations.CreateModel(
            name='Size',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100,
                                          verbose_name='naam')),
            ],
            options={
                'verbose_name': 'Afmeting',
                'verbose_name_plural': 'Afmetingen',
            },
        ),
        migrations.AddField(
            model_name='product',
            name='size',
            field=models.ManyToManyField(related_name='products',
                                         to='products.Size',
                                         verbose_name='afmeting'),
        ),
        migrations.AddField(
            model_name='price',
            name='product',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='prices',
                to='products.Product',
                verbose_name='artikel'),
        ),
    ]