# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-09 22:38
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('sites', '0002_alter_domain_unique'),
    ]

    operations = [
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('validated', models.BooleanField(default=False)),
                ('start_publication_on', models.DateTimeField(default=datetime.datetime.now)),
                ('end_publication_on', models.DateTimeField(blank=True, null=True)),
                ('lang', models.CharField(max_length=5)),
                ('title', models.CharField(max_length=100)),
                ('slug', models.SlugField(max_length=100, unique=True)),
                ('authors', models.CharField(max_length=200)),
                ('url', models.URLField(blank=True)),
                ('affiliate_url', models.URLField(blank=True)),
                ('isbn_10', models.CharField(blank=True, max_length=10, null=True)),
                ('isbn_13', models.CharField(blank=True, max_length=13, null=True)),
                ('asin', models.CharField(blank=True, max_length=20, null=True)),
                ('description', models.TextField()),
                ('cover', models.ImageField(blank=True, upload_to=books.models.cover_filename)),
            ],
            options={
                'verbose_name': 'Book',
                'verbose_name_plural': 'Books',
            },
            managers=[
                ('objects', django.db.models.manager.Manager()),
                ('on_site', books.models.SiteBookManager()),
            ],
        ),
        migrations.CreateModel(
            name='Editor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('slug', models.SlugField(unique=True)),
            ],
            options={
                'verbose_name': 'Editor',
                'verbose_name_plural': 'Editors',
            },
        ),
        migrations.AddField(
            model_name='book',
            name='editor',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='books.Editor'),
        ),
        migrations.AddField(
            model_name='book',
            name='site',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
        ),
    ]
