# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-25 00:35
from __future__ import unicode_literals

from django.conf import settings
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0008_alter_user_username_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='Usuario',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.ASCIIUsernameValidator()], verbose_name='username')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=30, verbose_name='last name')),
                ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('telefono', models.CharField(max_length=1000)),
                ('imageFile', models.ImageField(blank=True, null=True, upload_to='images')),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
            ],
            options={
                'abstract': False,
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Bodega',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('serial', models.CharField(max_length=50, null=True, unique=True)),
                ('nombre', models.CharField(max_length=100, null=True)),
                ('ubicacion', models.CharField(max_length=100, null=True)),
                ('niveles', models.IntegerField(null=True)),
                ('secciones', models.IntegerField(null=True)),
                ('temperatura_minima', models.DecimalField(decimal_places=8, max_digits=11, null=True)),
                ('temperatura_media', models.DecimalField(decimal_places=8, max_digits=11, null=True)),
                ('estado', models.BooleanField(default=True)),
                ('usuario_creacion', models.IntegerField(null=True)),
                ('usuario_actualizacion', models.IntegerField(null=True)),
                ('fecha_creacion', models.DateTimeField(null=True)),
                ('fecha_actualizacion', models.DateTimeField(null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Experimento',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('codigo', models.CharField(max_length=10, null=True, unique=True)),
                ('nombre', models.CharField(max_length=50)),
                ('fecha', models.DateField(null=True)),
                ('estado', models.CharField(max_length=50)),
                ('asignado', models.ManyToManyField(to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Producto',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('codigo', models.CharField(max_length=10, null=True, unique=True)),
                ('nombre', models.CharField(max_length=50, unique=True)),
                ('descripcion', models.CharField(max_length=200)),
                ('valorUnitario', models.IntegerField()),
                ('unidadesExistentes', models.IntegerField()),
                ('clasificacion', models.CharField(choices=[('Materiales Vivos', (('Bac', 'Bacterias'), ('Hon', 'Hongos'))), ('Medios de Cultivo', (('Glu', 'Glucosa'), ('Fru', 'Fructuosa'), ('Tri', 'Triptona'), ('Pep', 'Peptona'))), ('Micronutrientes', (('Fe', 'Hierro'), ('Mg', 'Magnesio'), ('P', 'Fosforo'))), ('Manipulacion ADN y Proteinas', (('Pri', 'Primers'), ('Kem', 'Kits de extraccion metagenomica'), ('KeADN', 'Kits de extraccion ADN aislado'), ('Pup', 'Purificador de proteinas'), ('Enr', 'Enzimas de restriccion'), ('Pro', 'Proteasas'))), ('Otros', 'Moleculas genericas')], max_length=35)),
                ('unidad_unitaria', models.DecimalField(decimal_places=8, max_digits=11, null=True)),
                ('imageFile', models.ImageField(blank=True, null=True, upload_to='images')),
            ],
        ),
        migrations.CreateModel(
            name='ProductoProtocolo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('descripcion', models.CharField(max_length=50)),
                ('cantidadUtilizada', models.DecimalField(decimal_places=3, max_digits=10, null=True)),
                ('producto', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='laboratorio.Producto')),
            ],
        ),
        migrations.CreateModel(
            name='ProductosEnBodega',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nivel', models.IntegerField(null=True)),
                ('seccion', models.IntegerField(null=True)),
                ('cantidad', models.IntegerField(null=True)),
                ('bodega', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='laboratorio.Bodega')),
                ('producto', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='laboratorio.Producto')),
            ],
        ),
        migrations.CreateModel(
            name='Protocolo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('version', models.BigIntegerField(null=True)),
                ('nombre', models.CharField(max_length=50)),
                ('fecha', models.DateField(null=True)),
                ('descripcion', models.CharField(max_length=1000)),
            ],
        ),
        migrations.CreateModel(
            name='Rol',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Tipo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('grupo', models.CharField(max_length=100, null=True)),
                ('nombre', models.CharField(max_length=100, null=True)),
                ('medidaDestino', models.CharField(max_length=100, null=True)),
                ('valor', models.DecimalField(decimal_places=8, max_digits=15, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='TransaccionInventario',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fecha_creacion', models.DateTimeField()),
                ('fecha_ejecucion', models.DateTimeField()),
                ('nivel_origen', models.IntegerField(null=True)),
                ('seccion_origen', models.IntegerField(null=True)),
                ('nivel_destino', models.IntegerField(null=True)),
                ('seccion_destino', models.IntegerField(null=True)),
                ('cantidad', models.IntegerField(default=0)),
                ('comentarios', models.CharField(max_length=200, null=True)),
                ('autoriza', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='autorizaTrx', to=settings.AUTH_USER_MODEL)),
                ('bodega_destino', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='bodegaDestino', to='laboratorio.Bodega')),
                ('bodega_origen', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='bodegaOrigen', to='laboratorio.Bodega')),
                ('estado', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tipo_estado', to='laboratorio.Tipo')),
                ('producto', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='laboratorio.Producto')),
                ('producto_bodega_destino', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ubucacionDestino', to='laboratorio.ProductosEnBodega')),
                ('producto_bodega_origen', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ubucacionOrigen', to='laboratorio.ProductosEnBodega')),
                ('tipo', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tipo_trx', to='laboratorio.Tipo')),
                ('unidad_medida', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tipo_unidadmedida', to='laboratorio.Tipo')),
                ('usuario', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='usuarioTrx', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='productosenbodega',
            name='unidad_medida',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='laboratorio.Tipo'),
        ),
        migrations.AddField(
            model_name='productoprotocolo',
            name='protocolo',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='laboratorio.Protocolo'),
        ),
        migrations.AddField(
            model_name='producto',
            name='unidad_medida',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='laboratorio.Tipo'),
        ),
        migrations.AddField(
            model_name='experimento',
            name='protocolo',
            field=models.ManyToManyField(to='laboratorio.Protocolo'),
        ),
        migrations.AddField(
            model_name='bodega',
            name='tipo_bodega',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='laboratorio.Tipo'),
        ),
        migrations.AddField(
            model_name='bodega',
            name='usuario',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='usuario',
            name='roles',
            field=models.ManyToManyField(to='laboratorio.Rol'),
        ),
        migrations.AddField(
            model_name='usuario',
            name='user_permissions',
            field=models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions'),
        ),
    ]
