# Generated by Django 2.2.6 on 2020-03-08 02:09

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Autor',
            fields=[
                ('autor_id', models.AutoField(primary_key=True, serialize=False)),
                ('nombre', models.CharField(max_length=100)),
                ('apellido', models.CharField(max_length=100)),
                ('email', models.EmailField(blank=True, max_length=100)),
            ],
            options={
                'ordering': ['apellido', 'nombre'],
            },
        ),
        migrations.CreateModel(
            name='Genero',
            fields=[
                ('genero_id', models.AutoField(primary_key=True, serialize=False)),
                ('nombre', models.CharField(help_text='Ingrese el nombre del género (p. ej. Ciencia Ficción, Poesía Francesa etc.)', max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Lenguaje',
            fields=[
                ('lenguaje_id', models.AutoField(primary_key=True, serialize=False)),
                ('idioma', models.CharField(help_text="Enter the book's natural language (e.g. English, French, Japanese etc.)", max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Libro',
            fields=[
                ('libro_id', models.AutoField(primary_key=True, serialize=False)),
                ('titulo', models.CharField(max_length=100, unique=True)),
                ('fechaPublicacion', models.DateField(verbose_name='Fecha de Publicacion')),
                ('numeroPaginas', models.IntegerField(verbose_name='Numero de paginas')),
                ('nombre_editorial', models.CharField(max_length=100, null=True, verbose_name='Editorial')),
                ('descripcion', models.CharField(help_text='Ingrese una breve descripción del libro', max_length=1000)),
                ('isbn', models.CharField(help_text='13 Caracteres <a href="https://www.isbn-international.org/content/what-isbn">ISBN number</a>', max_length=13, unique=True, verbose_name='ISBN')),
                ('imagen', models.ImageField(null=True, upload_to='imagenes/')),
                ('resumen', models.TextField(blank=True)),
                ('autor', models.ForeignKey(help_text='Eliga el autor del libro', null=True, on_delete=django.db.models.deletion.SET_NULL, to='modelo.Autor')),
                ('genero', models.ForeignKey(help_text='Seleccione un genero para este libro', null=True, on_delete=django.db.models.deletion.SET_NULL, to='modelo.Genero')),
            ],
        ),
        migrations.CreateModel(
            name='LibroInstancia',
            fields=[
                ('libroinstancia_id', models.UUIDField(default=uuid.uuid4, help_text='ID único para este libro particular en toda la biblioteca', primary_key=True, serialize=False)),
                ('fecha_devolucion', models.DateField(blank=True, null=True)),
                ('estado', models.CharField(blank=True, choices=[('m', 'Mantenimiento'), ('p', 'En prestamo'), ('d', 'Disponible'), ('r', 'Reservado')], default='m', help_text='Disponibilidad del libro', max_length=1)),
                ('libro', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='modelo.Libro')),
                ('prestatario', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'permissions': (('can_mark_returned', 'Set book as returned'),),
                'ordering': ['fecha_devolucion'],
            },
        ),
    ]
