class Migration(migrations.Migration):

    dependencies = [
        ('catalog', '0002_productimage'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='product',
            options={'verbose_name': '\u043f\u0440\u043e\u0434\u0443\u043a\u0442', 'verbose_name_plural': '\u041f\u0440\u043e\u0434\u0443\u043a\u0442'},
        ),
        migrations.AlterField(
            model_name='product',
            name='image',
            field=models.ImageField(upload_to=catalog.models.get_product_image_path, verbose_name='\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435'),
        ),
        migrations.AlterField(
            model_name='product',
            name='returned',
            field=models.IntegerField(default=0, editable=False, verbose_name='\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u043e'),
        ),
        migrations.AlterField(
            model_name='product',
            name='sales_count',
            field=models.IntegerField(default=0, editable=False, verbose_name='\u041f\u0440\u043e\u0434\u0430\u043d\u043e'),
        ),
        migrations.AlterField(
            model_name='productimage',
            name='image',
            field=models.ImageField(upload_to=catalog.models.get_product_image_image_path, verbose_name='\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f'),
        ),
    ]
Exemplo n.º 2
0
class Migration(migrations.Migration):

    dependencies = [
        ('catalog', '0006_auto_20170106_1919'),
    ]

    operations = [
        migrations.AlterField(
            model_name='spec_prod',
            name='code',
            field=models.IntegerField(default=catalog.models.get_code),
        ),
    ]
Exemplo n.º 3
0
class Migration(migrations.Migration):

    dependencies = [
        ('catalog', '0003_auto_20200610_2311'),
    ]

    operations = [
        migrations.AddField(
            model_name='book',
            name='published_year',
            field=models.IntegerField(
                help_text='Enter published year for this book',
                null=True,
                validators=[
                    django.core.validators.MinValueValidator(1000),
                    catalog.models.max_year_current
                ],
                verbose_name='published_year'),
        ),
    ]
Exemplo n.º 4
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='ShopItem',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('price',
                 models.DecimalField(decimal_places=2,
                                     default='0',
                                     max_digits=9,
                                     verbose_name='Цена')),
                ('first_image',
                 models.ImageField(null='media/no_image.png',
                                   upload_to=catalog.models.imagePath,
                                   verbose_name='Первое фото')),
                ('second_image',
                 models.ImageField(null='media/no_image.png',
                                   upload_to=catalog.models.imagePath,
                                   verbose_name='Второе фото')),
                ('title',
                 models.CharField(default='',
                                  max_length=120,
                                  verbose_name='Заголовок')),
                ('manufacter',
                 models.CharField(default='',
                                  max_length=50,
                                  verbose_name='Изготовитель')),
                ('slug',
                 models.SlugField(blank=True, editable=False, unique=True)),
                ('rating',
                 models.IntegerField(choices=[(1, '1'), (2, '2'), (3, '3'),
                                              (4, '4'), (5, '5')],
                                     default=1,
                                     verbose_name='Рейтинг')),
                ('category', models.CharField(editable=False, max_length=20)),
                ('clicks', models.IntegerField(default=0, editable=False)),
            ],
        ),
        migrations.CreateModel(
            name='Accessorie',
            fields=[
                ('shopitem_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='catalog.ShopItem')),
                ('type', models.CharField(max_length=50, verbose_name='Тип')),
                ('color', models.CharField(max_length=50,
                                           verbose_name='Цвет')),
            ],
            bases=('catalog.shopitem', ),
        ),
        migrations.CreateModel(
            name='Device',
            fields=[
                ('shopitem_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='catalog.ShopItem')),
                ('os',
                 models.CharField(default='Android',
                                  max_length=50,
                                  verbose_name='Система')),
                ('year', models.IntegerField(default=2010,
                                             verbose_name='Год')),
                ('camera', models.IntegerField(default=8,
                                               verbose_name='Камера')),
                ('display',
                 models.CharField(default='1920x1080',
                                  max_length=50,
                                  verbose_name='Разрешение')),
                ('battery',
                 models.IntegerField(default=1000, verbose_name='Батарея')),
                ('capacity',
                 models.IntegerField(default=1800,
                                     verbose_name='Вместимость')),
                ('chip',
                 models.CharField(default='MTK',
                                  max_length=50,
                                  verbose_name='Процессор')),
                ('color',
                 models.CharField(default='черный',
                                  max_length=50,
                                  verbose_name='Цвет')),
                ('has_wifi',
                 models.BooleanField(default=True,
                                     verbose_name='Есть Wi-fi?')),
                ('weight', models.IntegerField(default=400,
                                               verbose_name='Вес')),
            ],
            bases=('catalog.shopitem', ),
        ),
        migrations.CreateModel(
            name='Cable',
            fields=[
                ('accessorie_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='catalog.Accessorie')),
                ('features',
                 models.CharField(max_length=50, verbose_name='Вход')),
                ('compatibility',
                 models.CharField(max_length=50, verbose_name='Выход')),
            ],
            options={
                'verbose_name_plural': 'Кабеля',
            },
            bases=('catalog.accessorie', ),
        ),
        migrations.CreateModel(
            name='Cover',
            fields=[
                ('accessorie_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='catalog.Accessorie')),
                ('material',
                 models.CharField(max_length=50, verbose_name='Материал')),
                ('design',
                 models.CharField(max_length=50, verbose_name='Дизайн')),
            ],
            options={
                'verbose_name_plural': 'Чехлы',
            },
            bases=('catalog.accessorie', ),
        ),
        migrations.CreateModel(
            name='Headphone',
            fields=[
                ('accessorie_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='catalog.Accessorie')),
                ('communication',
                 models.CharField(max_length=50, verbose_name='Соединение')),
                ('frequency',
                 models.CharField(max_length=50,
                                  verbose_name='Максимальная частота')),
                ('connectors',
                 models.CharField(max_length=50, verbose_name='Разьем')),
            ],
            options={
                'verbose_name_plural': 'Наушники',
            },
            bases=('catalog.accessorie', ),
        ),
        migrations.CreateModel(
            name='Phone',
            fields=[
                ('device_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='catalog.Device')),
                ('access',
                 models.CharField(max_length=50, verbose_name='Доступ')),
                ('sim_format',
                 models.CharField(max_length=50,
                                  verbose_name='Поддерживаемый формат SIM')),
            ],
            options={
                'verbose_name_plural': 'Телефоны',
            },
            bases=('catalog.device', ),
        ),
        migrations.CreateModel(
            name='Sdcard',
            fields=[
                ('accessorie_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='catalog.Accessorie')),
                ('capacity', models.IntegerField(verbose_name='Вместимость')),
                ('speed', models.IntegerField(verbose_name='Скорость записи')),
            ],
            options={
                'verbose_name_plural': 'SD-карты',
            },
            bases=('catalog.accessorie', ),
        ),
        migrations.CreateModel(
            name='Tablet',
            fields=[
                ('device_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='catalog.Device')),
                ('has_pen', models.BooleanField(verbose_name='Есть стилус?')),
                ('has_keyboard',
                 models.BooleanField(verbose_name='Есть клавиатура?')),
            ],
            options={
                'verbose_name_plural': 'Планшеты',
            },
            bases=('catalog.device', ),
        ),
    ]
Exemplo n.º 5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Movies',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('plot', models.CharField(max_length=1000)),
                ('genres',
                 djongo.models.fields.ArrayModelField(
                     model_container=catalog.models.Genre)),
                ('runtime', models.PositiveIntegerField()),
                ('cast',
                 djongo.models.fields.ArrayModelField(
                     model_container=catalog.models.Cast)),
                ('poster', models.CharField(max_length=1000, null=True)),
                ('title', models.CharField(max_length=1000)),
                ('fullplot', models.CharField(max_length=1000)),
                ('countries',
                 djongo.models.fields.ArrayModelField(
                     model_container=catalog.models.Country)),
                ('released', models.DateField()),
                ('languages',
                 djongo.models.fields.ArrayModelField(
                     model_container=catalog.models.Language)),
                ('directors',
                 djongo.models.fields.ArrayModelField(
                     model_container=catalog.models.Director)),
                ('writers',
                 djongo.models.fields.ArrayModelField(
                     model_container=catalog.models.Writers)),
                ('year', models.PositiveIntegerField()),
                ('imdb',
                 djongo.models.fields.EmbeddedModelField(
                     model_container=catalog.models.Imdb, null=True)),
                ('tomatoes',
                 djongo.models.fields.EmbeddedModelField(
                     model_container=catalog.models.Tomatoes, null=True)),
                ('Douban',
                 djongo.models.fields.EmbeddedModelField(
                     model_container=catalog.models.DouBan, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Users',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=128)),
                ('email', models.EmailField(max_length=254, unique=True)),
                ('password', models.CharField(max_length=256)),
            ],
        ),
        migrations.CreateModel(
            name='Ratings',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date', models.DateField(auto_now_add=True)),
                ('rating',
                 models.IntegerField(
                     choices=[(0, '0'), (1,
                                         '1'), (2,
                                                '2'), (3,
                                                       '3'), (4,
                                                              '4'), (5,
                                                                     '5')])),
                ('movie_id',
                 djongo.models.fields.ArrayReferenceField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to='catalog.Movies')),
                ('user_id',
                 djongo.models.fields.ArrayReferenceField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to='catalog.Users')),
            ],
            options={
                'ordering': ['-date'],
            },
        ),
    ]
Exemplo n.º 6
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Market',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('type',
                 models.CharField(choices=[('sales channel', 'sales channel'),
                                           ('country', 'country')],
                                  max_length=255)),
                ('object_id', models.CharField(max_length=255)),
            ],
            options={
                'ordering': ('-created_at', '-updated_at'),
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('name', models.CharField(max_length=255)),
                ('slug', models.SlugField(unique=True)),
            ],
            options={
                'ordering': ('-created_at', '-updated_at'),
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SalesChannel',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('name', models.CharField(max_length=255)),
            ],
            options={
                'ordering': ('-created_at', '-updated_at'),
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Supplier',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('name', models.CharField(max_length=255)),
                ('default_availability',
                 models.CharField(choices=[('available', 'available'),
                                           ('unavailable', 'unavailable')],
                                  max_length=255)),
            ],
            options={
                'ordering': ('-created_at', '-updated_at'),
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SupplierArticle',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('article',
                 models.CharField(max_length=255,
                                  verbose_name=catalog.models.Article)),
                ('supplier_reference_number',
                 models.CharField(max_length=255)),
                ('stock', models.IntegerField(default=0)),
                ('supplier',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='catalog.Supplier')),
            ],
            options={
                'ordering': ('-created_at', '-updated_at'),
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SupplierSalesChannelArticle',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('price', models.DecimalField(decimal_places=2, max_digits=9)),
                ('price_old',
                 models.DecimalField(decimal_places=2, max_digits=9)),
                ('sales_channel',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='catalog.SalesChannel')),
                ('supplier_article',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='catalog.SupplierArticle')),
            ],
            options={
                'ordering': ('-created_at', '-updated_at'),
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SupplierMarketAvailability',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('supplier', models.CharField(max_length=255)),
                ('availability',
                 models.CharField(choices=[('available', 'available'),
                                           ('unavailable', 'unavailable')],
                                  max_length=255)),
                ('markets', models.ManyToManyField(to='catalog.Market')),
            ],
            options={
                'ordering': ('-created_at', '-updated_at'),
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('product',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='catalog.Product')),
            ],
            options={
                'ordering': ('-created_at', '-updated_at'),
                'abstract': False,
            },
        ),
    ]
Exemplo n.º 7
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')),
                ('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')),
                ('email', models.EmailField(max_length=254, unique=True, verbose_name='email address')),
                ('bool_is_author', models.BooleanField(default=False, help_text='Designates whether user is an author', verbose_name='Author')),
                ('bool_is_editor', models.BooleanField(default=False, help_text='Designates whether user is an editor', verbose_name='Editor')),
                ('bool_is_executive_editor', models.BooleanField(default=False, help_text='Designates whether user is an executive editor', verbose_name='Executive editor')),
                ('first_name', models.CharField(max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(max_length=30, verbose_name='last name')),
                ('bio', models.TextField(blank=True)),
                ('profile_pic', models.ImageField(blank=True, default='default_profile_pic.jpg', upload_to='')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', catalog.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=100)),
                ('text', models.TextField(default='Start typing here...')),
                ('thumb', models.ImageField(blank=True, default='default.png', upload_to='')),
                ('pub_date', models.DateTimeField(auto_now_add=True)),
                ('layout', models.CharField(choices=[('LO1', 'Normal'), ('LO2', 'Two columns'), ('LO3', 'Picture in middle')], default='LO1', max_length=3)),
                ('is_published', models.BooleanField(default=False, help_text='Publish article')),
                ('is_reviewed', models.BooleanField(default=False, help_text='Review article')),
                ('last_edited', models.DateTimeField(auto_now=True)),
                ('assigned_proof_read', models.ManyToManyField(blank=True, limit_choices_to={'bool_is_editor': True}, related_name='proof_read', to=settings.AUTH_USER_MODEL)),
                ('author', models.ManyToManyField(blank=True, limit_choices_to={'bool_is_author': True}, related_name='author', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-pub_date'],
            },
        ),
        migrations.CreateModel(
            name='ColorScheme',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('color', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('email', models.EmailField(max_length=254)),
                ('body', models.TextField()),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('active', models.BooleanField(default=True)),
                ('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='catalog.Article')),
            ],
            options={
                'ordering': ('created',),
            },
        ),
        migrations.CreateModel(
            name='Layout',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('layout', models.CharField(choices=[('layout_one_column.html', 'One column'), ('layout_articles_side_by_side.html', 'Two columns'), ('layout_big_article.html', 'Big two columns')], default='layout_one_column.html', max_length=33)),
            ],
        ),
        migrations.CreateModel(
            name='RateComment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('email', models.EmailField(max_length=254)),
                ('body', models.TextField()),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('active', models.BooleanField(default=True)),
                ('rating', models.IntegerField(default=1, validators=[django.core.validators.MaxValueValidator(10), django.core.validators.MinValueValidator(1)], verbose_name='Rating 1-10')),
                ('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ratecomments', to='catalog.Article')),
            ],
            options={
                'ordering': ('created',),
            },
        ),
        migrations.CreateModel(
            name='Request',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('body', models.TextField()),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20, unique=True)),
            ],
        ),
        migrations.AddField(
            model_name='article',
            name='tag',
            field=models.ManyToManyField(blank=True, related_name='article_tag', to='catalog.Tag'),
        ),
        migrations.AddField(
            model_name='user',
            name='favorites',
            field=models.ManyToManyField(blank=True, related_name='favorites', to='catalog.Article'),
        ),
        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='subscribe_author',
            field=models.ManyToManyField(blank=True, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='user',
            name='subscribe_tag',
            field=models.ManyToManyField(blank=True, related_name='subscribe_tag', to='catalog.Tag'),
        ),
        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'),
        ),
    ]
Exemplo n.º 8
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='CategoryProduct',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='ImagesProduct',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image_file',
                 models.ImageField(
                     upload_to=catalog.models.product_directory_path)),
                ('priority', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='MainCategoryProduct',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
            ],
        ),
        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)),
                ('description', models.TextField()),
                ('cost', models.DecimalField(decimal_places=2, max_digits=12)),
                ('rating', models.IntegerField()),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='catalog.CategoryProduct')),
            ],
        ),
        migrations.AddField(
            model_name='imagesproduct',
            name='product',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='catalog.Product'),
        ),
        migrations.AddField(
            model_name='categoryproduct',
            name='main_category',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='catalog.MainCategoryProduct'),
        ),
    ]
Exemplo n.º 9
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(max_length=100, unique=True)),
                ('email', models.EmailField(max_length=254, unique=True)),
                ('idnum', models.IntegerField(null=True, unique=True)),
                ('firstname', models.CharField(max_length=100)),
                ('lastname', models.CharField(max_length=100)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('is_manager', models.BooleanField(null=True)),
                ('is_administrator', models.BooleanField(null=True)),
                ('groups',
                 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')),
                ('user_permissions',
                 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')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
            },
            managers=[
                ('objects', catalog.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('author', models.TextField(max_length=200)),
                ('publisher', models.CharField(max_length=200)),
                ('publication_year', models.IntegerField()),
                ('isbn',
                 models.CharField(
                     help_text=
                     '13 Character <a href="https://www.isbn-international.org/content/what-isbn">ISBN number</a>',
                     max_length=13,
                     verbose_name='ISBN')),
                ('reserved', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='Review',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('content', models.TextField()),
            ],
        ),
    ]
Exemplo n.º 10
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Email',
            fields=[
                ('email_id',
                 models.CharField(default=catalog.models.generateUUID,
                                  editable=False,
                                  max_length=50,
                                  primary_key=True,
                                  serialize=False,
                                  unique=True)),
                ('email', models.CharField(max_length=50)),
            ],
            options={
                'db_table': 'email',
            },
        ),
        migrations.CreateModel(
            name='Name',
            fields=[
                ('name_id',
                 models.CharField(default=catalog.models.generateUUID,
                                  editable=False,
                                  max_length=50,
                                  primary_key=True,
                                  serialize=False,
                                  unique=True)),
                ('name', models.CharField(max_length=50)),
            ],
            options={
                'db_table': 'name',
            },
        ),
        migrations.CreateModel(
            name='Phone',
            fields=[
                ('phone_id',
                 models.CharField(default=catalog.models.generateUUID,
                                  editable=False,
                                  max_length=50,
                                  primary_key=True,
                                  serialize=False,
                                  unique=True)),
                ('phone', models.CharField(max_length=15)),
            ],
            options={
                'db_table': 'phone',
            },
        ),
        migrations.CreateModel(
            name='ReceiverCaller',
            fields=[
                ('receiver_caller_id',
                 models.CharField(default=catalog.models.generateUUID,
                                  editable=False,
                                  max_length=50,
                                  primary_key=True,
                                  serialize=False,
                                  unique=True)),
                ('caller_phone_no', models.CharField(max_length=15)),
                ('receiver_phone_no', models.CharField(max_length=15)),
            ],
            options={
                'db_table': 'receiver_caller',
            },
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('user_id',
                 models.CharField(default=catalog.models.generateUUID,
                                  editable=False,
                                  max_length=50,
                                  primary_key=True,
                                  serialize=False,
                                  unique=True)),
                ('name', models.CharField(max_length=50)),
                ('email', models.CharField(max_length=50)),
                ('phone', models.CharField(max_length=15)),
                ('password', models.CharField(max_length=255)),
                ('login_type', models.IntegerField()),
                ('login_counter', models.IntegerField()),
            ],
            options={
                'db_table': 'user',
            },
        ),
        migrations.CreateModel(
            name='VoiceReq',
            fields=[
                ('voice_req_id',
                 models.CharField(default=catalog.models.generateUUID,
                                  editable=False,
                                  max_length=50,
                                  primary_key=True,
                                  serialize=False,
                                  unique=True)),
                ('text', models.TextField()),
                ('audio_file_name', models.CharField(max_length=255)),
                ('record_start_time', models.DateField(max_length=15)),
                ('record_end_time', models.DateField(max_length=15)),
                ('created_date', models.DateField(max_length=15)),
                ('user_id',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='catalog.User')),
            ],
            options={
                'db_table': 'voice_req',
            },
        ),
        migrations.AddField(
            model_name='receivercaller',
            name='voice_req_id',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='catalog.VoiceReq'),
        ),
        migrations.AddField(
            model_name='phone',
            name='voice_req_id',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='catalog.VoiceReq'),
        ),
        migrations.AddField(
            model_name='name',
            name='voice_req_id',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='catalog.VoiceReq'),
        ),
        migrations.AddField(
            model_name='email',
            name='voice_req_id',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='catalog.VoiceReq'),
        ),
    ]
Exemplo n.º 11
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Attribute',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
            ],
            options={
                'verbose_name': 'Атрибут',
                'verbose_name_plural': 'Атрибуты',
            },
        ),
        migrations.CreateModel(
            name='Attribute_measure',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('measure',
                 models.CharField(max_length=60,
                                  unique=True,
                                  verbose_name='Значение')),
            ],
            options={
                'verbose_name': 'Единица измерения',
                'verbose_name_plural': 'Единицы измерения',
            },
        ),
        migrations.CreateModel(
            name='Attribute_title',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(max_length=60,
                                  unique=True,
                                  verbose_name='Наименование атрибута')),
            ],
            options={
                'verbose_name': 'Наименование атрибута',
                'verbose_name_plural': 'Наименование атрибутов',
            },
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(max_length=90,
                                  unique=True,
                                  verbose_name='Название')),
                ('slug',
                 models.SlugField(max_length=90,
                                  unique=True,
                                  verbose_name='URL')),
                ('description',
                 models.TextField(max_length=1500,
                                  verbose_name='Описание категории')),
                ('svg',
                 models.CharField(max_length=30,
                                  verbose_name='Название SVG, для меню')),
                ('img',
                 models.ImageField(
                     blank=True,
                     upload_to=catalog.models.Category.category_pic,
                     verbose_name='Изображение для категории')),
                ('attr_list',
                 models.ManyToManyField(
                     blank=True,
                     to='catalog.Attribute',
                     verbose_name='Атрибуты для категории')),
                ('parent',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='catalog.Category')),
            ],
            options={
                'verbose_name': 'Категория',
                'verbose_name_plural': 'Категории',
                'db_table': 'category',
            },
        ),
        migrations.CreateModel(
            name='Manufacturer',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(max_length=60,
                                  unique=True,
                                  verbose_name='Название компании')),
                ('slug', models.SlugField(unique=True, verbose_name='URL')),
                ('image',
                 models.FileField(
                     blank=True,
                     upload_to=catalog.models.Manufacturer.manufact_pic,
                     validators=[
                         django.core.validators.FileExtensionValidator(
                             ['svg', 'png', 'jpg', 'jpeg', 'webp'])
                     ],
                     verbose_name='Логотип')),
                ('description',
                 models.TextField(blank=True,
                                  max_length=1500,
                                  verbose_name='Описание')),
                ('link',
                 models.CharField(blank=True,
                                  max_length=120,
                                  verbose_name='Ссылка на сайт')),
            ],
            options={
                'verbose_name': 'Производитель',
                'verbose_name_plural': 'Производители',
                'db_table': 'manufacturer',
            },
        ),
        migrations.CreateModel(
            name='Orders',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('first_name',
                 models.CharField(max_length=120, verbose_name='Имя')),
                ('last_name',
                 models.CharField(db_index=True,
                                  max_length=120,
                                  verbose_name='Фамилия')),
                ('email',
                 models.CharField(max_length=120, verbose_name='E-mail')),
                ('address',
                 models.CharField(max_length=120, verbose_name='Адрес')),
                ('comment', models.TextField(verbose_name='Комментарий')),
                ('products', models.TextField(verbose_name='Товары')),
                ('status',
                 models.CharField(choices=[('Оформлен', 'Оформлен'),
                                           ('В обработке', 'В обработке'),
                                           ('Готов', 'Готов')],
                                  default='Оформлен',
                                  max_length=100)),
                ('total_price',
                 models.DecimalField(decimal_places=2,
                                     default=0.0,
                                     max_digits=100,
                                     verbose_name='Итоговая стоимость')),
            ],
            options={
                'verbose_name': 'Заказ',
                'verbose_name_plural': 'Заказы',
            },
        ),
        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,
                                  unique=True,
                                  verbose_name='Наименование')),
                ('articul', models.IntegerField(verbose_name='Артикул')),
                ('slug',
                 models.SlugField(max_length=30,
                                  unique=True,
                                  verbose_name='URL')),
                ('img',
                 models.ImageField(
                     upload_to=catalog.models.Product.get_file_path,
                     verbose_name='Главная картинка')),
                ('price',
                 models.DecimalField(
                     decimal_places=2,
                     default=1.0,
                     max_digits=12,
                     validators=[
                         django.core.validators.MinValueValidator(1.0)
                     ],
                     verbose_name='Цена за 1')),
                ('s_description',
                 models.TextField(max_length=600,
                                  verbose_name='Краткое описание')),
                ('description',
                 models.TextField(max_length=2000,
                                  verbose_name='Полное описание')),
                ('add_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Дата добавления')),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='catalog.Category',
                                   verbose_name='Категория')),
                ('manufacturer',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='catalog.Manufacturer',
                                   verbose_name='Производитель')),
            ],
            options={
                'verbose_name': 'Товар',
                'verbose_name_plural': 'Товары',
                'db_table': 'product',
            },
        ),
        migrations.CreateModel(
            name='ProductImages',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image',
                 models.ImageField(
                     upload_to=catalog.models.ProductImages.get_file_path,
                     verbose_name='Изображение')),
                ('product',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='catalog.Product',
                                   verbose_name='Товар')),
            ],
            options={
                'verbose_name': 'Изображения товаров',
                'verbose_name_plural': 'Изображения товаров',
            },
        ),
        migrations.CreateModel(
            name='Attribute_list',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('value',
                 models.CharField(max_length=20, verbose_name='Значение')),
                ('attribute',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='catalog.Attribute',
                                   verbose_name='Атрибут')),
                ('product',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='catalog.Product',
                                   verbose_name='Товар')),
            ],
            options={
                'verbose_name': 'Пул атрибутов',
                'verbose_name_plural': 'Пул атрибутов',
            },
        ),
        migrations.AddField(
            model_name='attribute',
            name='measure',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='catalog.Attribute_measure',
                verbose_name='Ед. Измерения'),
        ),
        migrations.AddField(
            model_name='attribute',
            name='title',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='catalog.Attribute_title',
                verbose_name='Атрибут'),
        ),
    ]
Exemplo n.º 12
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')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('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')),
                ('email',
                 models.EmailField(max_length=254,
                                   unique=True,
                                   verbose_name='email address')),
                ('groups',
                 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')),
                ('user_permissions',
                 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')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', catalog.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='service_project',
            fields=[
                ('project_ID',
                 models.IntegerField(primary_key=True, serialize=False)),
                ('project_title',
                 models.CharField(help_text='Enter field documentation',
                                  max_length=15)),
                ('project_duration',
                 models.CharField(help_text='Enter field documentation',
                                  max_length=15)),
                ('project_location',
                 models.CharField(help_text='Enter field documentation',
                                  max_length=15)),
                ('project_leader',
                 models.CharField(help_text='Enter field documentation',
                                  max_length=15)),
                ('project_date',
                 models.CharField(help_text='Enter field documentation',
                                  max_length=15)),
                ('members_needed', models.IntegerField(default=4)),
                ('wait_list', models.IntegerField(default=2)),
            ],
            options={
                'db_table': 'catalog_service_project',
            },
        ),
        migrations.CreateModel(
            name='work_order',
            fields=[
                ('work_order_id',
                 models.IntegerField(primary_key=True, serialize=False)),
            ],
        ),
    ]
Exemplo n.º 13
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=30,
                                  verbose_name='Название категории')),
                ('slug',
                 models.SlugField(max_length=30,
                                  unique=True,
                                  verbose_name='URL категории')),
                ('img',
                 models.ImageField(upload_to=catalog.models.category_img_name,
                                   verbose_name='Картинка категории')),
            ],
            options={
                'verbose_name': 'Категория',
                'verbose_name_plural': 'Категории',
            },
        ),
        migrations.CreateModel(
            name='Manufacture',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=30,
                                  verbose_name='Название компании')),
                ('slug',
                 models.SlugField(max_length=30,
                                  unique=True,
                                  verbose_name='URL производителя')),
                ('img',
                 models.ImageField(
                     help_text='500x500px',
                     upload_to=catalog.models.manufacture_img_name,
                     verbose_name='Логотип компании')),
                ('country',
                 models.CharField(max_length=60,
                                  verbose_name='Страна производитель')),
            ],
            options={
                'verbose_name': 'Производитель',
                'verbose_name_plural': 'Производители',
            },
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=50, verbose_name='Имя товара')),
                ('slug',
                 models.SlugField(blank=True,
                                  max_length=30,
                                  unique=True,
                                  verbose_name='URL товара')),
                ('date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Дата добовления')),
                ('price',
                 models.IntegerField(help_text='руб.', verbose_name='Цена')),
                ('warehouse',
                 models.IntegerField(
                     help_text='шт.',
                     verbose_name='Количество товара на складе')),
                ('warranty',
                 models.IntegerField(help_text='месяцев',
                                     verbose_name='Гарантия')),
                ('description', models.TextField(verbose_name='Описание')),
                ('specifications',
                 models.TextField(verbose_name='Характеристики')),
                ('set', models.TextField(verbose_name='Комплект поставки')),
                ('categories',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='catalog.category',
                                   verbose_name='Категория')),
                ('manufacture',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='catalog.manufacture',
                     verbose_name='Производитель')),
            ],
            options={
                'verbose_name': 'Товар',
                'verbose_name_plural': 'Товары',
            },
        ),
        migrations.CreateModel(
            name='ProductsImage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('img',
                 models.ImageField(upload_to=catalog.models.product_img_name)),
                ('products',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='prodimg',
                                   to='catalog.product')),
            ],
            options={
                'verbose_name': 'Картинка товара',
                'verbose_name_plural': 'Картинки товаров',
            },
        ),
    ]