# Generated by Django 2.1.3 on 2018-11-06 18:36

from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import games.validators


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            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(db_index=True, error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 255 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=255, unique=True, validators=[django.core.validators.RegexValidator('^[\\w.@+-]+$', 'Enter a valid username. This value may contain only letters, numbers and @/./+/-/_ characters.', 'invalid')], verbose_name='email or phone')),
                ('email', models.EmailField(blank=True, max_length=254, null=True, verbose_name='email')),
                ('phone', models.CharField(blank=True, max_length=255, null=True, verbose_name='phone')),
                ('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')),
                ('name', models.CharField(blank=True, max_length=100, null=True, verbose_name='Имя')),
                ('surname', models.CharField(blank=True, max_length=100, null=True, verbose_name='Фамилия')),
                ('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')),
                ('user_permissions', 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')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
            },
        ),
        migrations.CreateModel(
            name='Audio',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('description', models.CharField(blank=True, max_length=100, null=True, verbose_name='Описание')),
                ('audio', models.FileField(upload_to='audios/', validators=[games.validators.validate_file_extension, games.validators.validate_file_size], verbose_name='Аудио')),
            ],
            options={
                'verbose_name': 'Аудио',
                'verbose_name_plural': 'Аудио',
            },
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('category', models.CharField(max_length=30, verbose_name='Категория')),
            ],
            options={
                'verbose_name': 'Категория',
                'verbose_name_plural': 'Категории',
            },
        ),
        migrations.CreateModel(
            name='Child',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=30, verbose_name='Имя')),
                ('birthday', models.DateTimeField(verbose_name='Дата рождения')),
                ('gender', models.CharField(choices=[('Мужской', 'Мужской'), ('Женский', 'Женский')], max_length=7, verbose_name='Пол')),
                ('photo', models.ImageField(null=True, upload_to='photos/', verbose_name='Фото')),
                ('statistic_last_updated', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Дата последнего обновления')),
                ('parent', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Дети',
                'verbose_name_plural': 'Дети',
            },
        ),
        migrations.CreateModel(
            name='Color',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('color', models.CharField(max_length=30, verbose_name='Цвет')),
            ],
            options={
                'verbose_name': 'Цвета',
                'verbose_name_plural': 'Цвета',
            },
        ),
        migrations.CreateModel(
            name='Comments',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.CharField(max_length=1000)),
                ('last_changed', models.DateTimeField(auto_now_add=True, null=True)),
                ('child', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='games.Child')),
            ],
        ),
        migrations.CreateModel(
            name='CompoundQuestion',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('part', models.CharField(max_length=30, verbose_name='Составная часть в виде вопроса')),
            ],
            options={
                'verbose_name': 'Составная часть вопроса',
                'verbose_name_plural': 'Составная часть вопроса',
            },
        ),
        migrations.CreateModel(
            name='DefinitionQuestion',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('definition', models.CharField(max_length=30, verbose_name='Определеяющий в виде вопроса')),
            ],
            options={
                'verbose_name': 'Определение в виде вопроса',
                'verbose_name_plural': 'Определение в виде вопроса',
            },
        ),
        migrations.CreateModel(
            name='Form',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('form', models.CharField(max_length=30, verbose_name='Форма')),
            ],
            options={
                'verbose_name': 'Форма',
                'verbose_name_plural': 'Форма',
            },
        ),
        migrations.CreateModel(
            name='FunctionalQuestion',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('question', models.CharField(max_length=30, verbose_name='Функциональный вопрос')),
            ],
            options={
                'verbose_name': 'Функциональный вопрос',
                'verbose_name_plural': 'Функциональный вопрос',
            },
        ),
        migrations.CreateModel(
            name='Game_1_obj',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('description', models.CharField(max_length=100, verbose_name='Название')),
                ('image', models.ImageField(null=True, upload_to='images/', verbose_name='Изображение')),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='games.Category', verbose_name='Категория')),
                ('color', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='games.Color', verbose_name='Цвет')),
                ('compound_question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='games.CompoundQuestion', verbose_name='Составная часть вопроса')),
                ('definition_question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='games.DefinitionQuestion', verbose_name='Определение в виде вопроса')),
                ('form', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='games.Form', verbose_name='Форма')),
                ('functional_question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='games.FunctionalQuestion', verbose_name='Функциональный вопрос')),
            ],
            options={
                'verbose_name': 'Объект игры 1',
                'verbose_name_plural': 'Объекты игры 1',
            },
        ),
        migrations.CreateModel(
            name='Material',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('material', models.CharField(max_length=30, verbose_name='Материал')),
            ],
            options={
                'verbose_name': 'Материал',
                'verbose_name_plural': 'Материал',
            },
        ),
        migrations.CreateModel(
            name='Quantity',
            fields=[
                ('description', models.CharField(max_length=50, primary_key=True, serialize=False, verbose_name='Количество')),
            ],
            options={
                'verbose_name': 'Количество',
                'verbose_name_plural': 'Показатель количества',
            },
        ),
        migrations.CreateModel(
            name='Rule',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('description', models.CharField(blank=True, max_length=100, null=True, verbose_name='Описание')),
                ('level', models.IntegerField(help_text='Целочисленное значение от 1 до 5', null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(5)], verbose_name='Уровень игры')),
                ('game', models.IntegerField(help_text='Целочисленное значение от 1 до 5', null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(5)], verbose_name='Номер игры')),
                ('completely_identical', models.BooleanField(default=True, help_text='Убрерите галочку, если точное совпадение не требуется', verbose_name='Точное совпадение')),
                ('completion_criterion', models.IntegerField(help_text='Целочисленное значение от 1 до 20', null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(20)], verbose_name='Количество для завершения уровня')),
                ('count_up', models.IntegerField(help_text='Целочисленное значение от 1 до 20', null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(20)], verbose_name='Количество картинок сверху')),
                ('count_bottom', models.IntegerField(help_text='Целочисленное значение от 1 до 20', null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(20)], verbose_name='Количество картинок снизу')),
            ],
            options={
                'verbose_name': 'Правило',
                'verbose_name_plural': 'Правила',
            },
        ),
        migrations.CreateModel(
            name='Statistic',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('game', models.IntegerField(help_text='Целочисленное значение от 1 до 5', null=True, unique=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(5)], verbose_name='Номер игры')),
                ('level', models.IntegerField(help_text='Целочисленное значение от 1 до 5', null=True, unique=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(5)], verbose_name='Уровень игры')),
                ('start_time', models.DateTimeField(verbose_name='Время начала')),
                ('end_time', models.DateTimeField(verbose_name='Время окончания')),
                ('duration', models.DateTimeField(verbose_name='Продолжительность')),
                ('mistakes_count', models.IntegerField(validators=[django.core.validators.MinValueValidator(0)], verbose_name='Количество ошибок')),
                ('correct_percentage', models.FloatField(validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1)], verbose_name='Процент верно выполненных')),
                ('child', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='games.Child')),
            ],
            options={
                'verbose_name': 'Статистика',
                'verbose_name_plural': 'Статистика',
            },
        ),
        migrations.CreateModel(
            name='SubCategory',
            fields=[
                ('description', models.CharField(max_length=100, primary_key=True, serialize=False, verbose_name='Подкатегория')),
            ],
            options={
                'verbose_name': 'Подкатегории',
                'verbose_name_plural': 'Подкатегория',
            },
        ),
        migrations.AlterUniqueTogether(
            name='rule',
            unique_together={('game', 'level')},
        ),
        migrations.AddField(
            model_name='game_1_obj',
            name='material',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='games.Material', verbose_name='Материал'),
        ),
        migrations.AddField(
            model_name='game_1_obj',
            name='quantity',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='games.Quantity', verbose_name='Количество'),
        ),
        migrations.AddField(
            model_name='game_1_obj',
            name='sub_category',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='games.SubCategory', verbose_name='Подкатегория'),
        ),
    ]
