# -*- coding: utf-8 -*-
# Generated by Django 1.9.3 on 2016-03-11 15:17
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import jsonfield.fields


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title_art', models.CharField(max_length=10)),
                ('title', models.CharField(max_length=200)),
                ('subtitle', models.CharField(max_length=500)),
                ('volumes_type', models.IntegerField(choices=[(0, b'Raccolta di n volumi'), (1, b'Volume Singolo')])),
                ('volumi_raccolta', models.IntegerField(blank=True, help_text=b'Numero totale dei volumi che compongono la raccolta', null=True)),
                ('numero_volume_della_raccolta', models.IntegerField(blank=True, help_text=b'Numero del volumi allinterno della raccolta', null=True)),
                ('conditions', models.IntegerField(blank=True, choices=[(0, b'Pessimo'), (1, b'Medio'), (2, b'Buono'), (3, b'Ottimo'), (4, b'Nuovo')], null=True)),
                ('conditions_detail', jsonfield.fields.JSONField(blank=True, null=True)),
                ('price', models.FloatField(blank=True, null=True)),
                ('cover', models.CharField(blank=True, choices=[(b'COPERTINA MORBIDA', b'Copertina Morbida'), (b'COPERTINA RIGIDA', b'Copertina Rigida'), (b'COPERTINA RIGIDA CON SOVRACOPERTA', b'Copertina Rigida con Sovracoperta'), (b'ALTRO', b'Altro')], max_length=20, null=True)),
                ('box', models.BooleanField(default=False)),
                ('page_number', models.IntegerField(blank=True, null=True)),
                ('width', models.IntegerField(blank=True, null=True)),
                ('weigth', models.IntegerField(blank=True, null=True)),
                ('heigth', models.IntegerField(blank=True, null=True)),
                ('description', models.CharField(max_length=2000)),
                ('language', models.CharField(blank=True, max_length=20, null=True)),
                ('archive_code', models.CharField(blank=True, max_length=10, null=True)),
                ('isbn_code_10', models.CharField(blank=True, max_length=10, null=True)),
                ('isbn_code_13', models.CharField(blank=True, max_length=13, null=True)),
                ('saleable', models.BooleanField(default=False)),
                ('publish', models.BooleanField(default=True)),
                ('note', models.CharField(blank=True, max_length=1000, null=True)),
                ('altri_canali', models.CharField(blank=True, max_length=1000, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='BookAuthor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=200, null=True)),
                ('nationality', models.CharField(blank=True, max_length=100, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='BookCategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tags', models.CharField(max_length=16)),
                ('order', models.IntegerField(blank=True, default=0, null=True)),
            ],
            options={
                'ordering': ['order'],
            },
        ),
        migrations.CreateModel(
            name='BookCategoryType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('category_type', models.CharField(blank=True, choices=[(b'PRIMA EDIZIONE', b'Prima Edizione'), (b'EDIZIONE ECONOMICA', b'Edizione Economica'), (b'LIBRO ANTICO', b'Libro Antico 400'), (b'LIBRO ANTICO', b'Libro Antico 500'), (b'LIBRO ANTICO', b'Libro Antico 600'), (b'LIBRO ANTICO', b'Libro Antico 700'), (b'LIBRO ANTICO', b'Libro Antico 800'), (b'LIBRO AUTOGRAFATO', b'Libro Autografato'), (b'LIBRO D ARTISTA', b'Libro d Artista')], max_length=30, null=True)),
                ('icon', models.ImageField(upload_to=b'category_type_image')),
            ],
        ),
        migrations.CreateModel(
            name='BookEditor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('editor', models.CharField(max_length=500)),
                ('nationality', models.CharField(blank=True, max_length=100, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='BookImage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to=b'book_images')),
                ('order', models.IntegerField(blank=True, default=0, null=True)),
                ('book', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='images', to='books.Book')),
            ],
            options={
                'ordering': ['order'],
            },
        ),
        migrations.CreateModel(
            name='BookShop',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('tags', models.ManyToManyField(to='books.BookCategory')),
            ],
        ),
        migrations.CreateModel(
            name='BookShopUser',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('bookshop', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='books.BookShop')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='CoverBack',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('back', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='CoverImposition',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('imposition', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='CoverMaterial',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('material', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='CoverRilegatura',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('rilegatura', models.CharField(max_length=100)),
            ],
        ),
        migrations.AddField(
            model_name='book',
            name='authors',
            field=models.ManyToManyField(to='books.BookAuthor'),
        ),
        migrations.AddField(
            model_name='book',
            name='back',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='books.CoverBack'),
        ),
        migrations.AddField(
            model_name='book',
            name='bookshop',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='books.BookShop'),
        ),
        migrations.AddField(
            model_name='book',
            name='category_type',
            field=models.ManyToManyField(to='books.BookCategoryType'),
        ),
        migrations.AddField(
            model_name='book',
            name='cover_material',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='books.CoverMaterial'),
        ),
        migrations.AddField(
            model_name='book',
            name='editor',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='books.BookEditor'),
        ),
        migrations.AddField(
            model_name='book',
            name='imposition',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='books.CoverImposition'),
        ),
        migrations.AddField(
            model_name='book',
            name='rilegatura',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='books.CoverRilegatura'),
        ),
        migrations.AddField(
            model_name='book',
            name='tags',
            field=models.ManyToManyField(to='books.BookCategory'),
        ),
    ]
