# Generated by Django 3.1.2 on 2020-10-24 20:21

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('references', '0005_publishinghouse'),
    ]

    operations = [
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='Title')),
                ('cover_photo', models.ImageField(upload_to='media/', verbose_name='Cover')),
                ('price', models.DecimalField(decimal_places=2, default=0.0, max_digits=10, verbose_name='Price in BYN')),
                ('format', models.CharField(choices=[('1', '84×108/16'), ('2', '70×90/8'), ('3', '70×90/16'), ('4', '75×90/16'), ('5', '60×90/16'), ('6', '84×108/32'), ('7', '70×90/32'), ('8', '70×108/32'), ('9', '60×90/32')], default=1, max_length=15, verbose_name='Format')),
                ('isbn_code', models.CharField(default='', max_length=20, verbose_name='ISBN')),
                ('publishing_date', models.DateField(default=datetime.date.today, verbose_name='Date of publishing')),
                ('pages_amount', models.PositiveIntegerField(default=0, verbose_name='Amount of pages')),
                ('binding', models.CharField(default='', max_length=50, verbose_name='Binding')),
                ('weight', models.PositiveIntegerField(default=0, verbose_name='Weight (g)')),
                ('books_amount', models.PositiveIntegerField(default=0, verbose_name='Left amount')),
                ('age_limit', models.CharField(choices=[('1', '18+'), ('2', '16+'), ('3', '14+'), ('4', '12+'), ('5', '10+'), ('6', '8+'), ('7', '6+'), ('8', '3+'), ('6', '0+')], default=1, max_length=4, verbose_name='Age limit')),
                ('rating', models.CharField(choices=[('0', '0'), ('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10')], default=0, max_length=10, verbose_name='Rating')),
                ('is_active', models.BooleanField(choices=[(True, 'Yes'), (False, 'No')], default=True, verbose_name='Is active?')),
                ('entry_date', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Date of entry')),
                ('update_date', models.DateTimeField(auto_now=True, null=True, verbose_name='Date of updating')),
                ('author', models.ManyToManyField(to='references.Author')),
                ('genre', models.ManyToManyField(to='references.Genre')),
                ('publishing_house', models.ForeignKey(default=1, on_delete=django.db.models.deletion.PROTECT, to='references.publishinghouse')),
                ('series', models.ForeignKey(default=1, on_delete=django.db.models.deletion.PROTECT, to='references.series')),
            ],
        ),
    ]
