# Generated by Django 3.1.1 on 2020-09-02 07:37

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import recipes.models


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Ingredient',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='Название')),
                ('units', models.CharField(max_length=10, verbose_name='Единицы измерения')),
            ],
        ),
        migrations.CreateModel(
            name='Ingredient_quantity',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantity', models.IntegerField(verbose_name='Колличество')),
            ],
        ),
        migrations.CreateModel(
            name='Recipe',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='Название')),
                ('image', models.ImageField(upload_to=recipes.models.Recipe.file_name, validators=[recipes.models.Recipe.validate_image], verbose_name='Картинка')),
                ('description', models.TextField(verbose_name='Текстовое описание')),
                ('tag', models.CharField(choices=[('breakfast', 'завтрак'), ('lunch', 'обед'), ('dinner', 'ужин')], default='breakfast', max_length=10, verbose_name='Тег')),
                ('preparing_time', models.TimeField(verbose_name='Время приготовления')),
                ('pub_date', models.DateTimeField(auto_now=True, verbose_name='Дата добавления')),
                ('slug', models.SlugField(max_length=150, unique=True, verbose_name='Слаг')),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='recipe_author', to=settings.AUTH_USER_MODEL, verbose_name='Автор')),
                ('ingredients', models.ManyToManyField(related_name='recipe_ingredients', to='recipes.Ingredient_quantity', verbose_name='Ингридиенты')),
            ],
        ),
    ]
