在使用django admin的过程中 遇到了这个错误
1. Both 'fieldsets' and 'fields' are specified. django.core.management.base.SystemCheckError: SystemCheckError:
System check identified some issues: django.core.management.base.SystemCheckError: SystemCheckError: System check identified some issues: ERRORS:<class 'Salesman.admin.UsrMngUserAdmin'>: (admin.E005) Both 'fieldsets' and 'fields' are specified. System check identified 1 issue (0 silenced).
在使用django的过程中 我们可能会遇到这个错误,这是因为在你的admin中既有 fieldsets 也有fields 这是我们只需要把他们删除一个就可以运行了。fields和fieldsets是一个东西。
fields = ('user_name','real_name','password','phone_no','email','status','department',)# 编辑表单 没有设置登录密码 需要转换 fieldsets = ( ['Main', { 'fields': ('user_name', 'real_name','password','phone_no','email','status',), }], ['Advance', { 'classes': ('collapse',), # CSS 'fields': ('department',), }]