from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.utils.translation import gettext_lazy
from account.models import User, Gender, Grade, Province, Company
class UserInfoAdmin(UserAdmin):
list_display = ('username', 'email', 'nickname')
filter_horizontal = ('groups', 'user_permissions')
fieldsets = (
(None, {'fields': ('username', 'nickname', 'mobile', 'email', 'grade_name', 'password')}),
(gettext_lazy('用户信息'), {'fields': ('gender', 'icon', 'province',
'company_name', 'title', 'contact', 'section',
'is_adult_hospital', 'is_signed', 'can_ocr', 'trans_union')}),
(gettext_lazy('Permissions'), {'fields': ('is_superuser', 'is_staff', 'is_active',
'groups', 'user_permissions')}),
# (gettext_lazy('Important dates'), {'fields': ('last_login', 'date_joined')}),
)
admin.site.register(User, UserInfoAdmin)
网友评论