I'm learning Django and found that we can use fieldsets to customise the way admin creation form looks like. Here is the code I'am using:
class CustomUserAdmin(UserAdmin):
add_form = CustomUserCreationForm
form = CustomUserChangeForm
model = CustomUser
list_display = ('email', 'age', 'is_staff', 'is_active',)
list_filter = ('email', 'age', 'is_staff', 'is_active',)
fieldsets = (
('Advanced options', {
'classes': ('wide',),
'fields': ('email', 'age', 'is_staff', 'is_active',),
}),
)
admin.site.register(CustomUser, CustomUserAdmin)
Here is the result:
As you can see this "fieldsets" does nothing for this creation page. And if I completely remove this "fieldsets" nothing will change. What I did wrong here? I want my fieldsets work.
Thank you!