# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-29 13:01
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='City',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('pinyin', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='District',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('city', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='education.City')),
            ],
        ),
        migrations.CreateModel(
            name='Grade',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=50)),
            ],
            options={
                'ordering': ['title'],
            },
        ),
        migrations.CreateModel(
            name='Level',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Problem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=50)),
                ('picture', models.ImageField(blank=True, null=True, upload_to='problem_pics/%Y-%m-%d/', verbose_name='Problem picture')),
                ('description', models.TextField(blank=True, max_length=1000, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Rating',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('mobile', models.CharField(max_length=50)),
                ('star', models.IntegerField(validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(5)])),
                ('comment', models.TextField(blank=True, max_length=200, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Student',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('full_name', models.CharField(max_length=50)),
                ('picture', models.ImageField(blank=True, null=True, upload_to='student_pics/%Y-%m-%d/', verbose_name='Student picture')),
                ('requirement', models.TextField(blank=True, max_length=1000, null=True)),
                ('district', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='education.District')),
            ],
        ),
        migrations.CreateModel(
            name='Subject',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=50)),
            ],
            options={
                'ordering': ['title'],
            },
        ),
        migrations.CreateModel(
            name='Teacher',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('full_name', models.CharField(max_length=50)),
                ('gender', models.CharField(choices=[('M', '\u7537'), ('F', '\u5973')], max_length=1, null=True)),
                ('school', models.CharField(blank=True, max_length=50, null=True)),
                ('department', models.CharField(blank=True, max_length=50, null=True)),
                ('picture', models.ImageField(blank=True, null=True, upload_to='teacher_pics/%Y-%m-%d/', verbose_name='\u4e0a\u4f20\u5934\u50cf\uff08\u8bf7\u4f7f\u7528\u771f\u5b9e\u7167\u7247\uff09')),
                ('verify_picture', models.ImageField(blank=True, null=True, upload_to='teacher_vers/%Y-%m-%d/', verbose_name='\u5b66\u751f\u8bc1\u9a8c\u8bc1\uff08\u5b66\u751f\u8bc1\u7167\u7247+\u624b\u5199\u8fb9\u9645\u6559\u80b2\uff09')),
                ('available', models.CharField(blank=True, max_length=200, null=True)),
                ('price', models.IntegerField(default=50)),
                ('achievement', models.TextField(blank=True, max_length=1000, null=True)),
                ('description', models.TextField(blank=True, max_length=1000, null=True)),
                ('district', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='education.District')),
                ('grades', models.ManyToManyField(to='education.Grade')),
                ('level', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='education.Level')),
                ('subjects', models.ManyToManyField(to='education.Subject')),
            ],
        ),
        migrations.AddField(
            model_name='student',
            name='subjects',
            field=models.ManyToManyField(to='education.Subject'),
        ),
        migrations.AddField(
            model_name='rating',
            name='teacher',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='education.Teacher'),
        ),
    ]
