# 后台显示客户资料
This commit is contained in:
parent
90e7b8fb69
commit
1a8f8b0af5
|
@ -9,10 +9,10 @@ USER_FIELDS = (
|
|||
|
||||
|
||||
class CustomUserAdmin(UserAdmin):
|
||||
list_display = ('username', 'email', 'position', 'is_staff')
|
||||
list_display = ('username', 'email', 'org', 'role', 'is_staff')
|
||||
add_fieldsets = USER_FIELDS
|
||||
fieldsets = UserAdmin.fieldsets + (
|
||||
(None, {'fields': ('phone', 'position', 'department', 'introduction')}),
|
||||
(None, {'fields': ('role', 'phone', 'org', 'position', 'department', 'introduction')}),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -14,12 +14,13 @@ def avatar_path(instance, filename):
|
|||
class User(AbstractUser):
|
||||
ROLES = (
|
||||
('admin', 'admin'),
|
||||
('customer', 'customer'),
|
||||
('editor', 'editor')
|
||||
)
|
||||
phone = models.CharField(max_length=11, null=True, blank=True, default='', verbose_name='电话')
|
||||
department = models.CharField(max_length=20, null=True, blank=True, default='', verbose_name='部门')
|
||||
position = models.CharField(max_length=50, null=True, blank=True, default='', verbose_name='职位')
|
||||
introduction = models.TextField(verbose_name='简介')
|
||||
introduction = models.TextField(null=True, blank=True, verbose_name='简介')
|
||||
org = models.CharField(max_length=100, null=True, blank=True, verbose_name='组织')
|
||||
role = models.CharField(max_length=20, default='admin', choices=ROLES, verbose_name='角色')
|
||||
avatar = models.ImageField(upload_to=avatar_path,
|
||||
|
|
Loading…
Reference in New Issue