Is it possible to have a exteneded user profile in the 'User' part of the admin. I have tried the following with a form (UserProfileForm(forms.ModelForm)) with 2 fields 'something' and 'something else'
class UserAdminCustom(UserAdmin):
form = UserProfileForm
fieldsets = (
(None, {'fields': ('username', 'password', 'something', 'something_else')}),
('Personal info', {'fields': ('first_name', 'last_name', 'email')}),
('Permissions', {'fields': ('is_staff', 'is_active', 'is_superuser', 'user_permissions')}),
('Important dates', {'fields': ('last_login', 'date_joined')}),
('Groups', {'fields': ('groups',)}),
)
admin.site.unregister(User)
admin.site.register(User, UserAdminCustom)
What it results in is the 2 new fields as expected in the User in admin but the fields are empty and it saves nothing to these fields on save.
Is the only option to use inlines, like below, or am I just missing something.
class UserProfile2Inline(admin.StackedInline):
model = UserProfile2
class UserAdminCustom(UserAdmin):
inlines = (UserProfile2Inline,)
admin.site.unregister(User)
admin.site.register(User, UserAdminCustom)
Cheers if someone can shed some light on this for me.
Elliot