# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-11-24 11:34
from __future__ import unicode_literals

import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import usersystem.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('experiment', '0005_auto_20161008_1521'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='AttachFile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('attach_file', models.FileField(blank=True, null=True, upload_to=usersystem.models.report_file_upload_path_)),
                ('name', models.CharField(default='', max_length=512)),
            ],
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(blank=True, null=True, upload_to=usersystem.models.report_image_upload_path_)),
                ('create_date', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Institute',
            fields=[
                ('iid', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=256)),
            ],
        ),
        migrations.CreateModel(
            name='Major',
            fields=[
                ('mid', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=256)),
                ('institute', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='major', to='usersystem.Institute')),
            ],
        ),
        migrations.CreateModel(
            name='Report',
            fields=[
                ('rid', models.AutoField(primary_key=True, serialize=False)),
                ('is_corrected', models.BooleanField(default=False)),
                ('total_grades', models.IntegerField(default=0)),
                ('raw_data', models.TextField(default='')),
                ('objective', models.TextField(default='')),
                ('process', models.TextField(default='')),
                ('instrument', models.TextField(default='')),
                ('principle', models.TextField(default='')),
                ('data_processing', models.TextField(default='')),
                ('thinking', models.TextField(default='')),
                ('is_submit', models.BooleanField(default=False)),
                ('back_reason', models.TextField(default='')),
                ('experiment', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='report', to='experiment.Experiment')),
            ],
        ),
        migrations.CreateModel(
            name='ReportTag',
            fields=[
                ('tid', models.AutoField(primary_key=True, serialize=False)),
                ('grade', models.IntegerField(default=0)),
                ('reason', models.CharField(default='', max_length=256)),
                ('html', models.TextField(default='')),
                ('block', models.CharField(default='', max_length=128)),
            ],
        ),
        migrations.CreateModel(
            name='StudentClass',
            fields=[
                ('cid', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=256)),
                ('major', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='student_class', to='usersystem.Major')),
            ],
        ),
        migrations.CreateModel(
            name='UserBaseInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('name', models.CharField(default='anonymous', max_length=128)),
                ('phone', models.CharField(default='', max_length=64)),
                ('photo', models.ImageField(blank=True, null=True, upload_to=usersystem.models._image_upload_path_)),
                ('group', models.CharField(default='student', max_length=64)),
                ('address', models.CharField(default='', max_length=1024)),
                ('is_email_active', models.BooleanField(default=False)),
                ('is_account_active', models.BooleanField(default=False)),
                ('experiment', models.ManyToManyField(related_name='user', to='experiment.Experiment')),
                ('student_class', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='user', to='usersystem.StudentClass')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='userBaseInfo', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('created',),
            },
        ),
        migrations.CreateModel(
            name='WebsiteConfig',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('default_password', models.CharField(default='123456', max_length=128)),
                ('sitename', models.CharField(default='example.com:8001', max_length=128)),
                ('start_week_day', models.DateField(default=datetime.date(2016, 9, 4))),
                ('report_editing_day', models.IntegerField(default=7)),
                ('default_head_img', models.ImageField(upload_to=usersystem.models.website_file_upload_path)),
                ('welcome_word', models.CharField(default='', max_length=1024)),
                ('show_extra_block', models.BooleanField(default=True)),
            ],
        ),
        migrations.AddField(
            model_name='reporttag',
            name='config',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tag', to='usersystem.WebsiteConfig'),
        ),
        migrations.AddField(
            model_name='reporttag',
            name='report',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tag', to='usersystem.Report'),
        ),
        migrations.AddField(
            model_name='report',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='report', to='usersystem.UserBaseInfo'),
        ),
        migrations.AddField(
            model_name='image',
            name='report',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='image', to='usersystem.Report'),
        ),
        migrations.AddField(
            model_name='attachfile',
            name='report',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='file', to='usersystem.Report'),
        ),
    ]
