I have a User model (stock django), linked with a UserProfile
via a OneToOneField
. Is it possible to display data from the UserProfile
in the admin, when displaying users in tabular view?
I am doing:
class UserAdmin(UserAdmin):
inlines = (UserprofileInline,)
list_display = (
'username', 'email', 'first_name', 'last_name', 'is_staff'
)
# Re-register UserAdmin
admin.site.unregister(User)
admin.site.register(User, UserAdmin)
How can I extend the list_display
parameter to specify fields belonging to the UserProfile
?