修改用户模型,增加部分字段
This commit is contained in:
19
account/migrations/0011_user_auth_token.py
Normal file
19
account/migrations/0011_user_auth_token.py
Normal file
@@ -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),
|
||||||
|
),
|
||||||
|
]
|
||||||
19
account/migrations/0012_auto_20151012_1546.py
Normal file
19
account/migrations/0012_auto_20151012_1546.py
Normal file
@@ -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),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -29,7 +29,7 @@ class User(AbstractBaseUser):
|
|||||||
# 用户邮箱
|
# 用户邮箱
|
||||||
email = models.EmailField(max_length=254, blank=True, null=True)
|
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是超级管理员
|
# 0代表不是管理员 1是普通管理员 2是超级管理员
|
||||||
admin_type = models.IntegerField(default=0)
|
admin_type = models.IntegerField(default=0)
|
||||||
# JSON字典用来表示该用户的问题的解决状态 1为ac,2为正在进行
|
# JSON字典用来表示该用户的问题的解决状态 1为ac,2为正在进行
|
||||||
@@ -38,6 +38,8 @@ class User(AbstractBaseUser):
|
|||||||
reset_password_token = models.CharField(max_length=40, blank=True, null=True)
|
reset_password_token = models.CharField(max_length=40, blank=True, null=True)
|
||||||
# token 生成时间
|
# token 生成时间
|
||||||
reset_password_token_create_time = models.DateTimeField(blank=True, null=True)
|
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'
|
USERNAME_FIELD = 'username'
|
||||||
REQUIRED_FIELDS = []
|
REQUIRED_FIELDS = []
|
||||||
|
|||||||
Reference in New Issue
Block a user