From dd0b2042dccec584b52cdb9508bff2d5f57302de Mon Sep 17 00:00:00 2001 From: virusdefender <1670873886@qq.com> Date: Mon, 12 Oct 2015 18:22:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=EF=BC=8C=E5=A2=9E=E5=8A=A0=E9=83=A8=E5=88=86=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- account/migrations/0011_user_auth_token.py | 19 +++++++++++++++++++ account/migrations/0012_auto_20151012_1546.py | 19 +++++++++++++++++++ account/models.py | 4 +++- 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 account/migrations/0011_user_auth_token.py create mode 100644 account/migrations/0012_auto_20151012_1546.py diff --git a/account/migrations/0011_user_auth_token.py b/account/migrations/0011_user_auth_token.py new file mode 100644 index 0000000..01a3dc5 --- /dev/null +++ b/account/migrations/0011_user_auth_token.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('account', '0010_remove_user_login_failed_counter'), + ] + + operations = [ + migrations.AddField( + model_name='user', + name='auth_token', + field=models.CharField(max_length=40, null=True, blank=True), + ), + ] diff --git a/account/migrations/0012_auto_20151012_1546.py b/account/migrations/0012_auto_20151012_1546.py new file mode 100644 index 0000000..a4f937d --- /dev/null +++ b/account/migrations/0012_auto_20151012_1546.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('account', '0011_user_auth_token'), + ] + + operations = [ + migrations.AlterField( + model_name='user', + name='create_time', + field=models.DateTimeField(auto_now_add=True, null=True), + ), + ] diff --git a/account/models.py b/account/models.py index ee0cf18..4c6bfca 100644 --- a/account/models.py +++ b/account/models.py @@ -29,7 +29,7 @@ class User(AbstractBaseUser): # 用户邮箱 email = models.EmailField(max_length=254, blank=True, null=True) # 用户注册时间 - create_time = models.DateTimeField(auto_now_add=True) + create_time = models.DateTimeField(auto_now_add=True, null=True) # 0代表不是管理员 1是普通管理员 2是超级管理员 admin_type = models.IntegerField(default=0) # JSON字典用来表示该用户的问题的解决状态 1为ac,2为正在进行 @@ -38,6 +38,8 @@ class User(AbstractBaseUser): reset_password_token = models.CharField(max_length=40, blank=True, null=True) # token 生成时间 reset_password_token_create_time = models.DateTimeField(blank=True, null=True) + # 论坛授权token + auth_token = models.CharField(max_length=40, blank=True, null=True) USERNAME_FIELD = 'username' REQUIRED_FIELDS = []