# Generated by Django 2.0.6 on 2018-06-19 22:34

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('users', '0002_auto_20180619_2157'),
    ]

    operations = [
        migrations.CreateModel(
            name='Answer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.TextField(help_text='Esta respuesta puede ser de texto abierto, un id del item                             de la respuesta, una fecha, o un True o False', verbose_name='Respueta')),
                ('choice', models.CharField(blank=True, max_length=255, null=True, verbose_name='Id de la respuesta')),
            ],
            options={
                'verbose_name': 'Respuesta',
                'verbose_name_plural': 'Respuestas',
            },
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, unique=True, verbose_name='Nombre Categoría')),
                ('is_active', models.BooleanField(default=True, verbose_name='Es activo?')),
                ('weight', models.IntegerField(default=0, verbose_name='Peso de la Categoría')),
            ],
            options={
                'verbose_name': 'Categoría',
                'verbose_name_plural': 'Categorías',
            },
        ),
        migrations.CreateModel(
            name='Form',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField(auto_now=True, verbose_name='Fecha Diligenciamiento')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='related_companies_forms', to='users.Company', verbose_name='Compañia')),
            ],
            options={
                'verbose_name': 'Formulario',
                'verbose_name_plural': 'Formularios',
            },
        ),
        migrations.CreateModel(
            name='Question',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('context', models.TextField(help_text='Escribe la pregunta del formulario', verbose_name='Pregunta')),
                ('question_type', models.CharField(choices=[('TA', 'Texto Abierto'), ('SE', 'Selección Multiple, única respuesta'), ('FE', 'Fecha'), ('BO', 'Booleano')], max_length=2, verbose_name='Tipo de Pregunta')),
                ('weight', models.IntegerField(default=0, verbose_name='Peso de la pregunta')),
                ('is_active', models.BooleanField(default=True, verbose_name='Pregunta Activa?')),
                ('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='related_questions', to='gathering.Category', verbose_name='Categoría')),
            ],
            options={
                'verbose_name': 'Pregunta',
                'verbose_name_plural': 'Preguntas',
            },
        ),
        migrations.CreateModel(
            name='QuestionChoice',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.CharField(max_length=255, verbose_name='Valor')),
                ('weight', models.IntegerField(verbose_name='Peso de la opción de la pregunta')),
                ('dependant_question', models.ManyToManyField(blank=True, related_name='related_dependant_questions', to='gathering.Question', verbose_name='Depende de otra pregunta?')),
                ('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='related_question_choices', to='gathering.Question', verbose_name='Pregunta')),
            ],
            options={
                'verbose_name': 'Opcion de la Pregunta',
                'verbose_name_plural': 'Opciones de Pregunta',
            },
        ),
        migrations.AddField(
            model_name='answer',
            name='form',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='gathering.Form', verbose_name='Formulario'),
        ),
        migrations.AddField(
            model_name='answer',
            name='question',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='gathering.Question', verbose_name='Pregunta'),
        ),
        migrations.AlterUniqueTogether(
            name='answer',
            unique_together={('form', 'question')},
        ),
    ]
