增加了用户管理和编辑的API及相应的测试

This commit is contained in:
hohoTT
2015-08-07 20:25:58 +08:00
parent d64b99eed3
commit 69385e96d2
5 changed files with 136 additions and 8 deletions

View File

@@ -2,7 +2,7 @@
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
import account.models
class Migration(migrations.Migration):
@@ -18,10 +18,17 @@ class Migration(migrations.Migration):
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(null=True, verbose_name='last login', blank=True)),
('username', models.CharField(unique=True, max_length=30)),
('real_name', models.CharField(max_length=30, null=True, blank=True)),
('email', models.EmailField(max_length=254, null=True, blank=True)),
('create_time', models.DateTimeField(auto_now_add=True)),
('admin_type', models.IntegerField(default=0)),
],
options={
'db_table': 'user',
},
managers=[
('objects', account.models.UserManager()),
],
),
migrations.CreateModel(
name='AdminGroup',
@@ -29,9 +36,4 @@ class Migration(migrations.Migration):
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
],
),
migrations.AddField(
model_name='user',
name='admin_group',
field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, to='account.AdminGroup', null=True),
),
]