# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-03-09 22:20
from __future__ import unicode_literals

import django.contrib.auth.models
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0007_alter_validators_add_error_messages'),
    ]

    operations = [
        migrations.CreateModel(
            name='Author',
            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(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=30, unique=True, validators=[django.core.validators.RegexValidator('^[\\w.@+-]+$', 'Enter a valid username. This value may contain only letters, numbers and @/./+/-/_ characters.')], verbose_name='username')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=30, verbose_name='last name')),
                ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
                ('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')),
                ('avatar', models.ImageField(blank=True, default=b'user/avatar/guest.png', upload_to=b'user/avatar/', verbose_name='\u5934\u50cf')),
                ('bio', models.TextField(blank=True, max_length=1000, verbose_name='\u4e2a\u4eba\u7b80\u4ecb')),
                ('location', models.CharField(blank=True, max_length=50, verbose_name='\u5730\u5740')),
                ('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={
                'abstract': False,
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('article_link', models.CharField(blank=True, max_length=100, verbose_name='\u94fe\u63a5')),
                ('article_title', models.CharField(max_length=100, verbose_name='\u6587\u7ae0\u6807\u9898')),
                ('author', models.CharField(max_length=50, verbose_name='\u4f5c\u8005')),
                ('content_md', models.TextField(verbose_name='\u6587\u7ae0\u5185\u5bb9(md\u683c\u5f0f)')),
                ('content_html', models.TextField(null=True, verbose_name='\u6587\u7ae0\u5185\u5bb9(Html\u683c\u5f0f)')),
                ('views', models.IntegerField(verbose_name='\u6d4f\u89c8\u91cf')),
                ('created_time', models.DateTimeField(default=django.utils.timezone.now, verbose_name='\u521b\u5efa\u65f6\u95f4')),
                ('updated_time', models.DateTimeField(verbose_name='\u66f4\u65b0\u65f6\u95f4')),
                ('status', models.CharField(choices=[(b'd', '\u8349\u7a3f'), (b'p', '\u53d1\u5e03')], default=b'd', max_length=1, verbose_name='\u72b6\u6001')),
            ],
            options={
                'ordering': ['-created_time'],
                'verbose_name': '\u6587\u7ae0',
                'verbose_name_plural': '\u6587\u7ae0',
            },
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(db_index=True, max_length=30, unique=True, verbose_name='\u540d\u79f0')),
                ('created_time', models.DateTimeField(default=django.utils.timezone.now, verbose_name='\u521b\u5efa\u65f6\u95f4')),
            ],
            options={
                'ordering': ['name'],
                'verbose_name': '\u6587\u7ae0\u5206\u7c7b',
                'verbose_name_plural': '\u6587\u7ae0\u5206\u7c7b',
            },
        ),
        migrations.CreateModel(
            name='ReadBooks',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(db_index=True, max_length=100, unique=True, verbose_name='\u4e66\u540d')),
                ('author', models.CharField(max_length=100, verbose_name='\u4f5c\u8005')),
                ('book_link', models.URLField(verbose_name='\u4e66\u7c4d\u8c46\u74e3\u94fe\u63a5')),
                ('cover', models.URLField(verbose_name='\u5c01\u9762\u56fe\u7247\u94fe\u63a5')),
                ('review', models.TextField(verbose_name='\u8bfb\u540e\u611f')),
                ('score', models.FloatField(verbose_name='\u8bc4\u5206')),
                ('status', models.IntegerField(choices=[(0, '\u5df2\u8bfb'), (1, '\u5728\u8bfb'), (2, '\u60f3\u8bfb')], default=1, verbose_name='\u72b6\u6001')),
            ],
            options={
                'ordering': ['title'],
                'verbose_name': '\u8bfb\u4e66',
                'verbose_name_plural': '\u8bfb\u4e66',
            },
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(db_index=True, max_length=30, unique=True, verbose_name='\u540d\u79f0')),
                ('created_time', models.DateTimeField(default=django.utils.timezone.now, verbose_name='\u521b\u5efa\u65f6\u95f4')),
            ],
            options={
                'ordering': ['name'],
                'verbose_name': '\u6587\u7ae0\u6807\u7b7e',
                'verbose_name_plural': '\u6587\u7ae0\u6807\u7b7e',
            },
        ),
        migrations.AddField(
            model_name='article',
            name='category',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='blog.Category', verbose_name='\u6240\u5c5e\u5206\u7c7b'),
        ),
        migrations.AddField(
            model_name='article',
            name='tags',
            field=models.ManyToManyField(to='blog.Tag', verbose_name='\u6807\u7b7e\u96c6\u5408'),
        ),
    ]
