# Generated by Django 3.1.2 on 2020-11-07 08:13

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


class Migration(migrations.Migration):

    dependencies = [
        ('books', '0002_genre_series'),
    ]

    operations = [
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=255, verbose_name='Название')),
                ('price', models.PositiveIntegerField(verbose_name='Цена')),
                ('ID', models.PositiveSmallIntegerField(verbose_name='ID')),
                ('ISBN', models.CharField(max_length=30, verbose_name='ISBN')),
                ('pages_amount', models.PositiveIntegerField(verbose_name='Количество страниц')),
                ('weight', models.PositiveIntegerField(verbose_name='Масса')),
                ('sizes', models.CharField(max_length=20, verbose_name='Размеры')),
                ('cover_type', models.CharField(choices=[('solid', '7Б - твердая (плотная бумага или картон)'), ('soft', 'мягкий переплет (крепление скрепкой или клеем)'), ('with_flaps', 'Обл. с клапанами')], default='solid', max_length=50, verbose_name='Тип обложки')),
                ('illustrations_info', models.CharField(choices=[('bw', 'Черно-белые'), ('color', 'Цветные'), ('none', 'Без иллюстраций')], default='bw', max_length=50, verbose_name='Информация об иллюстрации')),
                ('annotation', models.TextField(verbose_name='Аннотация')),
                ('published_date', models.DateField(auto_now_add=True, verbose_name='Дата публикации')),
                ('authors', models.ManyToManyField(to='books.Author', verbose_name='Авторы')),
                ('genre', models.ManyToManyField(to='books.Genre', verbose_name='Жанр')),
                ('publishing_house', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='books.publishinghouse', verbose_name='Издательство')),
                ('series', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='books.series', verbose_name='Серия')),
            ],
            options={
                'verbose_name': 'Книга',
                'verbose_name_plural': 'Книги',
                'ordering': ['published_date', 'title'],
            },
        ),
    ]
