# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-04-24 09:23
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20, verbose_name='Имя')),
                ('last_name', models.CharField(max_length=30, verbose_name='Фамилия')),
                ('bio', models.TextField(verbose_name='Биография')),
            ],
            options={
                'verbose_name': 'Автор',
                'verbose_name_plural': 'Авторы',
            },
        ),
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=50, verbose_name='Название')),
                ('annotation', models.TextField(verbose_name='Аннотация')),
                ('img', models.ImageField(default='/img/no-img.jpg', upload_to='img/')),
                ('receipt_date', models.DateField(verbose_name='Дата поступления')),
                ('status', models.CharField(choices=[('y', 'Есть в наличии'), ('n', 'Нет в наличии')], max_length=1, verbose_name='Статус')),
                ('count', models.PositiveSmallIntegerField(default=1, verbose_name='Количество')),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='book.Author')),
            ],
            options={
                'verbose_name': 'Книга',
                'verbose_name_plural': 'Книги',
            },
        ),
        migrations.CreateModel(
            name='Genre',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=50, verbose_name='Название')),
            ],
            options={
                'verbose_name': 'Жанр',
                'verbose_name_plural': 'Жанры',
            },
        ),
        migrations.AddField(
            model_name='book',
            name='genre',
            field=models.ManyToManyField(blank=True, to='book.Genre', verbose_name='Жанр'),
        ),
    ]
