# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-03-23 09:47
from __future__ import unicode_literals

import book.models
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('book', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Books',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=500, unique=True)),
                ('slug', models.CharField(max_length=500, unique=True)),
                ('image', models.ImageField(upload_to=book.models.image_upload_to)),
                ('isbn10', models.CharField(max_length=10, validators=[django.core.validators.RegexValidator(message='Length has to be 10', regex='^.{10}$')])),
                ('isbn13', models.CharField(max_length=13, validators=[django.core.validators.RegexValidator(message='Length has to be 13', regex='^.{13}$')])),
                ('language', models.CharField(choices=[('en', 'english')], max_length=2)),
                ('binding', models.CharField(choices=[('pb', 'paperback')], max_length=2)),
                ('cost_price', models.DecimalField(decimal_places=2, max_digits=10)),
                ('selling_price', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
                ('author', models.ManyToManyField(to='book.Author')),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='book.SubCategory')),
                ('publisher', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='book.Publisher')),
            ],
        ),
    ]
