# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-20 20:33
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import markdownx.models
import tagulous.models.fields
import tagulous.models.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='_Tagulous_Problem_author',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, unique=True)),
                ('slug', models.SlugField()),
                ('count', models.IntegerField(default=0, help_text='Internal counter of how many times this tag is in use')),
                ('protected', models.BooleanField(default=False, help_text='Will not be deleted when the count reaches 0')),
            ],
            options={
                'ordering': ('name',),
                'abstract': False,
            },
            bases=(tagulous.models.models.BaseTagModel, models.Model),
        ),
        migrations.CreateModel(
            name='_Tagulous_Problem_book',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, unique=True)),
                ('slug', models.SlugField()),
                ('count', models.IntegerField(default=0, help_text='Internal counter of how many times this tag is in use')),
                ('protected', models.BooleanField(default=False, help_text='Will not be deleted when the count reaches 0')),
            ],
            options={
                'ordering': ('name',),
                'abstract': False,
            },
            bases=(tagulous.models.models.BaseTagModel, models.Model),
        ),
        migrations.CreateModel(
            name='_Tagulous_Problem_lmsh',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, unique=True)),
                ('slug', models.SlugField()),
                ('count', models.IntegerField(default=0, help_text='Internal counter of how many times this tag is in use')),
                ('protected', models.BooleanField(default=False, help_text='Will not be deleted when the count reaches 0')),
            ],
            options={
                'ordering': ('name',),
                'abstract': False,
            },
            bases=(tagulous.models.models.BaseTagModel, models.Model),
        ),
        migrations.CreateModel(
            name='_Tagulous_Problem_olymp',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, unique=True)),
                ('slug', models.SlugField()),
                ('count', models.IntegerField(default=0, help_text='Internal counter of how many times this tag is in use')),
                ('protected', models.BooleanField(default=False, help_text='Will not be deleted when the count reaches 0')),
            ],
            options={
                'ordering': ('name',),
                'abstract': False,
            },
            bases=(tagulous.models.models.BaseTagModel, models.Model),
        ),
        migrations.CreateModel(
            name='ImageSource',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('source', models.FileField(upload_to='image_sources/')),
            ],
        ),
        migrations.CreateModel(
            name='Problem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=200, verbose_name='Название')),
                ('task', markdownx.models.MarkdownxField()),
                ('answer', models.CharField(blank=True, max_length=200, verbose_name='Ответ')),
                ('direction', models.CharField(blank=True, max_length=200, verbose_name='Указание')),
                ('solution', models.TextField(blank=True, max_length=2000, verbose_name='Решение')),
                ('grade_down', models.IntegerField(choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9), (10, 10)], verbose_name='От класса')),
                ('grade_up', models.IntegerField(choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9), (10, 10)], verbose_name='До класса')),
                ('more_info', models.TextField(blank=True, max_length=2000, verbose_name='Дополнительная информация')),
                ('category', models.CharField(choices=[('school', 'Школьные'), ('olymp', 'Олимпиадные'), ('science', 'Исследовательские')], default='olymp', max_length=10, verbose_name='Категория')),
                ('year', models.IntegerField(choices=[(2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001)], default=None, verbose_name='Год')),
                ('grade', models.IntegerField(choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9), (10, 10)], default=None, verbose_name='Класс')),
                ('number', models.IntegerField(default=None, verbose_name='Номер задачи')),
                ('author', tagulous.models.fields.TagField(_set_tag_meta=True, blank=True, help_text='Enter a comma-separated tag string', space_delimiter=False, to='problems._Tagulous_Problem_author')),
                ('book', tagulous.models.fields.TagField(_set_tag_meta=True, blank=True, help_text='Enter a comma-separated tag string', space_delimiter=False, to='problems._Tagulous_Problem_book')),
                ('lmsh', tagulous.models.fields.TagField(_set_tag_meta=True, blank=True, help_text='Enter a comma-separated tag string', space_delimiter=False, to='problems._Tagulous_Problem_lmsh')),
                ('olymp', tagulous.models.fields.TagField(_set_tag_meta=True, blank=True, help_text='Enter a comma-separated tag string', space_delimiter=False, to='problems._Tagulous_Problem_olymp')),
            ],
        ),
        migrations.CreateModel(
            name='Source',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, unique=True)),
                ('slug', models.SlugField()),
                ('count', models.IntegerField(default=0, help_text='Internal counter of how many times this tag is in use')),
                ('protected', models.BooleanField(default=False, help_text='Will not be deleted when the count reaches 0')),
                ('path', models.CharField(max_length=255, unique=True)),
                ('label', models.CharField(help_text='The name of the tag, without ancestors', max_length=255)),
                ('level', models.IntegerField(default=1, help_text='The level of the tag in the tree')),
                ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='problems.Source')),
            ],
            options={
                'ordering': ('name',),
                'abstract': False,
            },
            bases=(tagulous.models.models.BaseTagTreeModel, models.Model),
        ),
        migrations.CreateModel(
            name='Theme',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, unique=True)),
                ('slug', models.SlugField()),
                ('count', models.IntegerField(default=0, help_text='Internal counter of how many times this tag is in use')),
                ('protected', models.BooleanField(default=False, help_text='Will not be deleted when the count reaches 0')),
                ('path', models.CharField(max_length=255, unique=True)),
                ('label', models.CharField(help_text='The name of the tag, without ancestors', max_length=255)),
                ('level', models.IntegerField(default=1, help_text='The level of the tag in the tree')),
                ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='problems.Theme')),
            ],
            options={
                'ordering': ('name',),
                'abstract': False,
            },
            bases=(tagulous.models.models.BaseTagTreeModel, models.Model),
        ),
        migrations.AddField(
            model_name='problem',
            name='theme',
            field=tagulous.models.fields.TagField(_set_tag_meta=True, autocomplete_view='problem_themes_autocomplete', blank=True, force_lowercase=True, help_text='Enter a comma-separated tag string', initial='"Геометрия/Синусы и косинусы", Арифметика, Арифметика/Дроби, Геометрия, Тригонометрия/Синусы', space_delimiter=False, to='problems.Theme', tree=True),
        ),
        migrations.AddField(
            model_name='imagesource',
            name='problem',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='problems.Problem'),
        ),
        migrations.AlterUniqueTogether(
            name='_tagulous_problem_olymp',
            unique_together=set([('slug',)]),
        ),
        migrations.AlterUniqueTogether(
            name='_tagulous_problem_lmsh',
            unique_together=set([('slug',)]),
        ),
        migrations.AlterUniqueTogether(
            name='_tagulous_problem_book',
            unique_together=set([('slug',)]),
        ),
        migrations.AlterUniqueTogether(
            name='_tagulous_problem_author',
            unique_together=set([('slug',)]),
        ),
        migrations.AlterUniqueTogether(
            name='theme',
            unique_together=set([('slug', 'parent')]),
        ),
        migrations.AlterUniqueTogether(
            name='source',
            unique_together=set([('slug', 'parent')]),
        ),
    ]
