I’m attempting to combine the admin form for the User and my UserProfile model. I found out how to do it here, which works. I have this now:
#DJANGOPROJECT/generic/admin.py
class UserProfileInline(admin.TabularInline):
model = UserProfile
class UserAdmin(admin.ModelAdmin):
inlines = [UserProfileInline]
admin.site.unregister(admin.models.User)
admin.site.register(admin.models.User, UserAdmin)
However, the form generated in the admin contains five instances of the user profile form, instead of one. I don’t understand why this is?
https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.InlineModelAdmin
Try to set max_num to 1