I want to add my settings.AUTH_USER_MODEL to my admin insted of User model.
I register it with the snippet I found in the docs:
class UserAdmin(BaseUserAdmin):
# The forms to add and change user instances
form = UserChangeForm
add_form = UserCreationForm
# The fields to be used in displaying the User model.
# These override the definitions on the base UserAdmin
# that reference specific fields on auth.User.
list_display = ('email', 'bdate')
fieldsets = (
(None, {'fields': ('email', 'password')}),
('Personal info', {'fields': ('bdate', 'website', 'location')}),
)
# add_fieldsets is not a standard ModelAdmin attribute. UserAdmin
# overrides get_fieldsets to use this attribute when creating a user.
add_fieldsets = (
(None, {
'classes': ('wide',),
'fields': ('email', 'password1', 'password2')}
),
)
search_fields = ('email',)
ordering = ('email',)
filter_horizontal = ()
In fieldsets Personal info I added all my custom info. Now I also want to display all inherited fields like first_name, username, etc. I can add them one by one to fieldsets, but I am not sure if that's the right way.
Is there a way just to inherit them from User model without specifying explicitly?