# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
from django.conf import settings
import mtp.apps.common.utils
import django_extensions.db.fields


class Migration(migrations.Migration):

    dependencies = [
        ('sync', '0002_auto_20150831_1334'),
        ('trainings', '0019_auto_20150831_1334'),
        ('accounts', '0012_auto_20150831_1334'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('evaluations', '0004_auto_20150828_1745'),
    ]

    operations = [
        migrations.CreateModel(
            name='Axis',
            fields=[
                ('sort_order', models.IntegerField(db_index=True, blank=True)),
                ('id', django_extensions.db.fields.UUIDField(editable=False, blank=True, serialize=False, primary_key=True)),
                ('is_deleted', models.BooleanField(default=False)),
                ('update_locally', models.BooleanField(default=False)),
                ('name', models.CharField(max_length=500)),
            ],
            options={
                'ordering': ['sort_order'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Criterion',
            fields=[
                ('sort_order', models.IntegerField(db_index=True, blank=True)),
                ('id', django_extensions.db.fields.UUIDField(editable=False, blank=True, serialize=False, primary_key=True)),
                ('is_deleted', models.BooleanField(default=False)),
                ('update_locally', models.BooleanField(default=False)),
                ('description', models.TextField(verbose_name='description')),
                ('criterion_type', models.CharField(help_text='Type of criterion', max_length=2, choices=[('QL', 'Qualitative'), ('QT', 'Quantitative')], verbose_name='criterion type')),
            ],
            options={
                'ordering': ['sort_order'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Evaluation',
            fields=[
                ('trainingactivity_ptr', models.OneToOneField(parent_link=True, to='trainings.TrainingActivity', primary_key=True, serialize=False, auto_created=True)),
                ('hidden', models.BooleanField(default=False, verbose_name='hidden')),
            ],
            options={
                'abstract': False,
            },
            bases=('trainings.trainingactivity',),
        ),
        migrations.CreateModel(
            name='EvaluationGroupPermission',
            fields=[
                ('id', django_extensions.db.fields.UUIDField(editable=False, blank=True, serialize=False, primary_key=True)),
                ('is_deleted', models.BooleanField(default=False)),
                ('update_locally', models.BooleanField(default=False)),
                ('permission', models.CharField(max_length=32, choices=[('may_evaluate_self', 'May evaluate self'), ('may_evaluate_others', 'May evaluate others'), ('may_moderate_others', 'May moderate others'), ('may_observe_others', 'May observe others')], verbose_name='permission')),
                ('evaluation', models.ForeignKey(to='evaluations.Evaluation')),
                ('first_update', models.ForeignKey(related_name='evaluations_evaluationgrouppermission_by_first', blank=True, to='sync.Update', null=True)),
                ('group', models.ForeignKey(to='accounts.Group')),
                ('last_update', models.ForeignKey(related_name='evaluations_evaluationgrouppermission_by_last', blank=True, to='sync.Update', null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Exercise',
            fields=[
                ('sort_order', models.IntegerField(db_index=True, blank=True)),
                ('id', django_extensions.db.fields.UUIDField(editable=False, blank=True, serialize=False, primary_key=True)),
                ('is_deleted', models.BooleanField(default=False)),
                ('update_locally', models.BooleanField(default=False)),
                ('name', models.CharField(max_length=50, verbose_name='name')),
                ('description', models.TextField(verbose_name='description')),
                ('start_range', models.PositiveIntegerField(default=1)),
                ('end_range', models.PositiveIntegerField(default=5)),
                ('step', models.PositiveIntegerField(default=1)),
                ('preview', models.ImageField(upload_to=mtp.apps.common.utils.upload_to_generator, blank=True, null=True, verbose_name='preview')),
                ('evaluation', models.ForeignKey(to='evaluations.Evaluation', related_name='exercises')),
                ('first_update', models.ForeignKey(related_name='evaluations_exercise_by_first', blank=True, to='sync.Update', null=True)),
                ('last_update', models.ForeignKey(related_name='evaluations_exercise_by_last', blank=True, to='sync.Update', null=True)),
                ('original_version', models.ForeignKey(null=True, to='evaluations.Exercise', related_name='all_duplicates')),
                ('parent_version', models.ForeignKey(null=True, to='evaluations.Exercise', related_name='direct_duplicates')),
            ],
            options={
                'ordering': ['sort_order'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Graph',
            fields=[
                ('sort_order', models.IntegerField(db_index=True, blank=True)),
                ('id', django_extensions.db.fields.UUIDField(editable=False, blank=True, serialize=False, primary_key=True)),
                ('is_deleted', models.BooleanField(default=False)),
                ('update_locally', models.BooleanField(default=False)),
                ('name', models.CharField(max_length=500)),
                ('start_range', models.PositiveIntegerField(default=1)),
                ('end_range', models.PositiveIntegerField(default=5)),
                ('step', models.PositiveIntegerField(default=1)),
                ('evaluation', models.ForeignKey(to='evaluations.Evaluation')),
                ('first_update', models.ForeignKey(related_name='evaluations_graph_by_first', blank=True, to='sync.Update', null=True)),
                ('last_update', models.ForeignKey(related_name='evaluations_graph_by_last', blank=True, to='sync.Update', null=True)),
                ('session', models.ForeignKey(to='trainings.TrainingSession')),
                ('trainee', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['sort_order'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Rating',
            fields=[
                ('id', django_extensions.db.fields.UUIDField(editable=False, blank=True, serialize=False, primary_key=True)),
                ('is_deleted', models.BooleanField(default=False)),
                ('update_locally', models.BooleanField(default=False)),
                ('text', models.TextField(blank=True)),
                ('score', models.PositiveIntegerField(blank=True, null=True)),
                ('criterion', models.ForeignKey(to='evaluations.Criterion', related_name='ratings')),
                ('first_update', models.ForeignKey(related_name='evaluations_rating_by_first', blank=True, to='sync.Update', null=True)),
                ('judge', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='given_ratings')),
                ('last_update', models.ForeignKey(related_name='evaluations_rating_by_last', blank=True, to='sync.Update', null=True)),
                ('session', models.ForeignKey(related_name='evaluation_ratings', blank=True, to='trainings.TrainingSession', null=True)),
                ('trainee', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='received_ratings')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.RemoveField(
            model_name='evaluationaxis',
            name='criterias',
        ),
        migrations.RemoveField(
            model_name='evaluationaxis',
            name='first_update',
        ),
        migrations.RemoveField(
            model_name='evaluationaxis',
            name='last_update',
        ),
        migrations.RemoveField(
            model_name='evaluationaxis',
            name='questions',
        ),
        migrations.RemoveField(
            model_name='evaluationaxis',
            name='radar',
        ),
        migrations.RemoveField(
            model_name='evaluationcriterianumeric',
            name='exercice',
        ),
        migrations.RemoveField(
            model_name='evaluationcriterianumeric',
            name='first_update',
        ),
        migrations.RemoveField(
            model_name='evaluationcriterianumeric',
            name='last_update',
        ),
        migrations.RemoveField(
            model_name='evaluationcriterianumeric',
            name='original',
        ),
        migrations.RemoveField(
            model_name='evaluationcriterianumericvalue',
            name='candidate',
        ),
        migrations.RemoveField(
            model_name='evaluationcriterianumericvalue',
            name='evaluation_criteria_numeric',
        ),
        migrations.RemoveField(
            model_name='evaluationcriterianumericvalue',
            name='first_update',
        ),
        migrations.RemoveField(
            model_name='evaluationcriterianumericvalue',
            name='jury',
        ),
        migrations.RemoveField(
            model_name='evaluationcriterianumericvalue',
            name='last_update',
        ),
        migrations.RemoveField(
            model_name='evaluationcriterianumericvalue',
            name='training_session',
        ),
        migrations.RemoveField(
            model_name='evaluationcriteriaverbatim',
            name='exercice',
        ),
        migrations.RemoveField(
            model_name='evaluationcriteriaverbatim',
            name='first_update',
        ),
        migrations.RemoveField(
            model_name='evaluationcriteriaverbatim',
            name='last_update',
        ),
        migrations.RemoveField(
            model_name='evaluationcriteriaverbatim',
            name='original',
        ),
        migrations.RemoveField(
            model_name='evaluationcriteriaverbatimmod',
            name='first_update',
        ),
        migrations.RemoveField(
            model_name='evaluationcriteriaverbatimmod',
            name='last_update',
        ),
        migrations.RemoveField(
            model_name='evaluationcriteriaverbatimvalue',
            name='candidate',
        ),
        migrations.RemoveField(
            model_name='evaluationcriteriaverbatimvalue',
            name='evaluation_criteria_verbatim',
        ),
        migrations.RemoveField(
            model_name='evaluationcriteriaverbatimvalue',
            name='first_update',
        ),
        migrations.RemoveField(
            model_name='evaluationcriteriaverbatimvalue',
            name='jury',
        ),
        migrations.RemoveField(
            model_name='evaluationcriteriaverbatimvalue',
            name='last_update',
        ),
        migrations.RemoveField(
            model_name='evaluationcriteriaverbatimvalue',
            name='training_session',
        ),
        migrations.RemoveField(
            model_name='evaluationcriteriaverbatimvaluemod',
            name='candidate',
        ),
        migrations.RemoveField(
            model_name='evaluationcriteriaverbatimvaluemod',
            name='evaluation_criteria_verbatim_moderator',
        ),
        migrations.RemoveField(
            model_name='evaluationcriteriaverbatimvaluemod',
            name='evaluation_criteria_verbatim_value',
        ),
        migrations.RemoveField(
            model_name='evaluationcriteriaverbatimvaluemod',
            name='first_update',
        ),
        migrations.RemoveField(
            model_name='evaluationcriteriaverbatimvaluemod',
            name='last_update',
        ),
        migrations.RemoveField(
            model_name='evaluationcriteriaverbatimvaluemod',
            name='training_session',
        ),
        migrations.RemoveField(
            model_name='evaluationexercice',
            name='evaluation_type',
        ),
        migrations.RemoveField(
            model_name='evaluationexercice',
            name='first_update',
        ),
        migrations.RemoveField(
            model_name='evaluationexercice',
            name='last_update',
        ),
        migrations.RemoveField(
            model_name='evaluationexercice',
            name='original',
        ),
        migrations.RemoveField(
            model_name='evaluationgraph',
            name='evaluation_type',
        ),
        migrations.RemoveField(
            model_name='evaluationgraph',
            name='first_update',
        ),
        migrations.RemoveField(
            model_name='evaluationgraph',
            name='last_update',
        ),
        migrations.RemoveField(
            model_name='evaluationgraph',
            name='training',
        ),
        migrations.RemoveField(
            model_name='evaluationgraphproperties',
            name='evaluation_graph',
        ),
        migrations.RemoveField(
            model_name='evaluationgraphproperties',
            name='first_update',
        ),
        migrations.RemoveField(
            model_name='evaluationgraphproperties',
            name='last_update',
        ),
        migrations.RemoveField(
            model_name='evaluationgraphproperties',
            name='mgroups',
        ),
        migrations.RemoveField(
            model_name='evaluationgraphproperties',
            name='user',
        ),
        migrations.RemoveField(
            model_name='evaluationtype',
            name='auto_evaluators',
        ),
        migrations.RemoveField(
            model_name='evaluationtype',
            name='auto_observers',
        ),
        migrations.RemoveField(
            model_name='evaluationtype',
            name='candidate',
        ),
        migrations.RemoveField(
            model_name='evaluationtype',
            name='evaluators',
        ),
        migrations.RemoveField(
            model_name='evaluationtype',
            name='first_update',
        ),
        migrations.RemoveField(
            model_name='evaluationtype',
            name='last_update',
        ),
        migrations.RemoveField(
            model_name='evaluationtype',
            name='moderators',
        ),
        migrations.RemoveField(
            model_name='evaluationtype',
            name='observers',
        ),
        migrations.RemoveField(
            model_name='evaluationtype',
            name='original',
        ),
        migrations.RemoveField(
            model_name='evaluationtype',
            name='training',
        ),
        migrations.AlterUniqueTogether(
            name='evaluationtypeproperties',
            unique_together=set([]),
        ),
        migrations.RemoveField(
            model_name='evaluationtypeproperties',
            name='evaluation_type',
        ),
        migrations.RemoveField(
            model_name='evaluationtypeproperties',
            name='first_update',
        ),
        migrations.RemoveField(
            model_name='evaluationtypeproperties',
            name='last_update',
        ),
        migrations.RemoveField(
            model_name='evaluationtypeproperties',
            name='mgroups',
        ),
        migrations.RemoveField(
            model_name='evaluationtypeproperties',
            name='original',
        ),
        migrations.RemoveField(
            model_name='evaluationtypeproperties',
            name='user',
        ),
        migrations.DeleteModel(
            name='EvaluationAxis',
        ),
        migrations.DeleteModel(
            name='EvaluationCriteriaNumeric',
        ),
        migrations.DeleteModel(
            name='EvaluationCriteriaNumericValue',
        ),
        migrations.DeleteModel(
            name='EvaluationCriteriaVerbatim',
        ),
        migrations.DeleteModel(
            name='EvaluationCriteriaVerbatimMod',
        ),
        migrations.DeleteModel(
            name='EvaluationCriteriaVerbatimValue',
        ),
        migrations.DeleteModel(
            name='EvaluationCriteriaVerbatimValueMod',
        ),
        migrations.DeleteModel(
            name='EvaluationExercice',
        ),
        migrations.DeleteModel(
            name='EvaluationGraph',
        ),
        migrations.DeleteModel(
            name='EvaluationGraphProperties',
        ),
        migrations.DeleteModel(
            name='EvaluationType',
        ),
        migrations.DeleteModel(
            name='EvaluationTypeProperties',
        ),
        migrations.AddField(
            model_name='evaluation',
            name='permissions',
            field=models.ManyToManyField(to='accounts.Group', blank=True, through='evaluations.EvaluationGroupPermission'),
        ),
        migrations.AddField(
            model_name='criterion',
            name='exercise',
            field=models.ForeignKey(to='evaluations.Exercise', related_name='criteria'),
        ),
        migrations.AddField(
            model_name='criterion',
            name='first_update',
            field=models.ForeignKey(related_name='evaluations_criterion_by_first', blank=True, to='sync.Update', null=True),
        ),
        migrations.AddField(
            model_name='criterion',
            name='last_update',
            field=models.ForeignKey(related_name='evaluations_criterion_by_last', blank=True, to='sync.Update', null=True),
        ),
        migrations.AddField(
            model_name='criterion',
            name='original_version',
            field=models.ForeignKey(null=True, to='evaluations.Criterion', related_name='all_duplicates'),
        ),
        migrations.AddField(
            model_name='criterion',
            name='parent_version',
            field=models.ForeignKey(null=True, to='evaluations.Criterion', related_name='direct_duplicates'),
        ),
        migrations.AddField(
            model_name='axis',
            name='criteria',
            field=models.ManyToManyField(to='evaluations.Criterion', blank=True),
        ),
        migrations.AddField(
            model_name='axis',
            name='first_update',
            field=models.ForeignKey(related_name='evaluations_axis_by_first', blank=True, to='sync.Update', null=True),
        ),
        migrations.AddField(
            model_name='axis',
            name='graph',
            field=models.ForeignKey(to='evaluations.Graph', related_name='axises'),
        ),
        migrations.AddField(
            model_name='axis',
            name='last_update',
            field=models.ForeignKey(related_name='evaluations_axis_by_last', blank=True, to='sync.Update', null=True),
        ),
        migrations.AlterUniqueTogether(
            name='evaluationgrouppermission',
            unique_together=set([('group', 'permission')]),
        ),
    ]
