# Generated by Django 3.1.5 on 2021-01-19 09:38

from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Cart',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('total_products', models.PositiveIntegerField(default=0, verbose_name='Количество')),
                ('total_price', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='Общая сумма')),
                ('comments', models.TextField(blank=True, verbose_name='Комментарий к заказу')),
                ('in_order', models.BooleanField(default=False)),
                ('for_anonymous_user', models.BooleanField(default=False)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(db_index=True, max_length=200)),
                ('slug', models.SlugField(max_length=200, unique=True)),
            ],
            options={
                'verbose_name': 'category',
                'verbose_name_plural': 'categories',
            },
        ),
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('phone', models.CharField(max_length=13, verbose_name='Номер телефона')),
                ('address', models.CharField(max_length=200, verbose_name='Адрес доставки')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='related_name', to=settings.AUTH_USER_MODEL, verbose_name='Пользователь')),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(db_index=True, max_length=255, verbose_name='Наименование')),
                ('vendor_code', models.CharField(db_index=True, max_length=6, unique=True, verbose_name='Артикул')),
                ('slug', models.SlugField(max_length=255, unique=True)),
                ('image', models.ImageField(blank=True, upload_to='', verbose_name='Изображение')),
                ('description', models.TextField(blank=True, verbose_name='Описание продукта')),
                ('price', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Цена')),
                ('available', models.BooleanField(default=True, verbose_name='В наличии')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='shop.category', verbose_name='Категория транспорта')),
            ],
            options={
                'ordering': ('title',),
                'index_together': {('id', 'slug')},
            },
        ),
        migrations.CreateModel(
            name='Review',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=50, verbose_name='Title')),
                ('reviews', models.TextField(max_length=255, verbose_name='Reviews')),
            ],
            options={
                'verbose_name': 'Review',
                'verbose_name_plural': 'Reviews',
            },
        ),
        migrations.CreateModel(
            name='Slider',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(error_messages={'max_length': 'Очень большая длина'}, help_text='просто название слайда до 100 символов, оно обязательно', max_length=100, validators=[django.core.validators.MaxLengthValidator(100)], verbose_name='Название слайда')),
                ('title', models.CharField(blank=True, error_messages={'max_length': 'Очень большая длина'}, help_text='до 150 символов, заполнять необязательно', max_length=150, validators=[django.core.validators.MaxLengthValidator(150)], verbose_name='Заголовок на слайде')),
                ('description', models.CharField(blank=True, error_messages={'max_length': 'Очень большая длина'}, help_text='до 150 символов, заполнять необязательно', max_length=150, validators=[django.core.validators.MaxLengthValidator(150)], verbose_name='Текст под заголовком')),
                ('slide_img', models.ImageField(help_text='изображение обрежется до 1920x1024px', upload_to='slider/', verbose_name='Добавить изображение')),
            ],
            options={
                'verbose_name': 'Блок 1.0: Слайдер',
                'verbose_name_plural': 'Блок 1.0: Слайдеры',
            },
        ),
        migrations.CreateModel(
            name='Status',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=30, verbose_name='Статус заказа')),
                ('in_active', models.BooleanField(default=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'Статус заказа',
                'verbose_name_plural': 'Статусы заказа',
            },
        ),
        migrations.CreateModel(
            name='CommercialVehicles',
            fields=[
                ('product_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='shop.product')),
                ('product_group', models.CharField(max_length=200, verbose_name='Группа продукта')),
                ('composition', models.CharField(blank=True, max_length=200, verbose_name='Состав продукта')),
                ('viscosity', models.CharField(max_length=6, verbose_name='Вязкость продукта')),
                ('volume', models.CharField(blank=True, max_length=6, verbose_name='Объем')),
                ('classification', models.CharField(blank=True, max_length=200, verbose_name='Классификация продукта')),
                ('manufacturer_approval', models.CharField(blank=True, max_length=200, verbose_name='Одобрение производителей')),
            ],
            bases=('shop.product',),
        ),
        migrations.CreateModel(
            name='LightMotor',
            fields=[
                ('product_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='shop.product')),
                ('product_group', models.CharField(max_length=200, verbose_name='Группа продукта')),
                ('composition', models.CharField(blank=True, max_length=200, verbose_name='Состав продукта')),
                ('viscosity', models.CharField(max_length=6, verbose_name='Вязкость продукта')),
                ('volume', models.CharField(blank=True, max_length=6, verbose_name='Объем')),
                ('classification', models.CharField(blank=True, max_length=200, verbose_name='Классификация продукта')),
                ('manufacturer_approval', models.CharField(blank=True, max_length=200, verbose_name='Одобрение производителей')),
                ('under_a_specific_brand', models.BooleanField(default=False, verbose_name='Под конкретную модель')),
                ('brand', models.CharField(blank=True, max_length=50, null=True, verbose_name='Марка автомобиля')),
                ('year_of_issue', models.DateField(blank=True, null=True, verbose_name='Год выпуска')),
            ],
            bases=('shop.product',),
        ),
        migrations.CreateModel(
            name='ProductCart',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantity', models.PositiveIntegerField(default=1, verbose_name='Количество')),
                ('total_price', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Общая сумма')),
                ('cart', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='related_products', to='shop.cart', verbose_name='Корзина')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='shop.product', verbose_name='Товар')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='shop.customer', verbose_name='Покупатель')),
            ],
        ),
        migrations.AddField(
            model_name='cart',
            name='owner',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='shop.customer', verbose_name='Владелец'),
        ),
        migrations.AddField(
            model_name='cart',
            name='product',
            field=models.ManyToManyField(blank=True, related_name='related_cart', to='shop.ProductCart', verbose_name='Продукт'),
        ),
        migrations.AddField(
            model_name='cart',
            name='status',
            field=models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, to='shop.status', verbose_name='Статус'),
        ),
    ]
