# Generated by Django 2.2 on 2019-11-16 06:38

from django.conf import settings
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='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, verbose_name='Товар')),
                ('category', models.CharField(choices=[('other', 'Другое'), ('food', 'Еда'), ('clothes', 'Одежда'), ('household', 'Товары для дома')], default='other', max_length=50, verbose_name='Категория')),
                ('description', models.TextField(blank=True, max_length=400, null=True, verbose_name='Описание')),
                ('photo', models.ImageField(blank=True, null=True, upload_to='product_images', verbose_name='Фото')),
            ],
            options={
                'verbose_name': 'Товар',
                'verbose_name_plural': 'Товары',
            },
        ),
        migrations.CreateModel(
            name='Otziv',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('description', models.TextField(max_length=400, verbose_name='Отзыв')),
                ('ocenka', models.IntegerField(choices=[('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5')], default='1', verbose_name='Оценка')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='webapp.Product', verbose_name='Товар')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='otziv', to=settings.AUTH_USER_MODEL, verbose_name='Автор')),
            ],
        ),
    ]
