0
我想添加添加内联模型并从Django管理中的用户更改表单中排除某些字段。如何正确覆盖Django中的用户管理
我试图重写Django的内置UserAdmin
保护用户改变设计:
class UserCustomAdmin(UserAdmin):
# list_display = ['id', 'username','email', 'last_login']
exclude = ['groups','user_permissions']
inlines = [UserProfileInline]
即使exclude = ['groups']
引发错误:
u"Key 'groups' not found in 'UserForm'. Choices are: date_joined, email, first_name, is_active, is_staff, is_superuser, last_login, last_name, password, username."
如何使它工作?