wasimbhalli
wasimbhalli

Reputation: 5242

How to handle Django ModelForm for Many-to-Many fields

I had to show many to many fields on admin pages of both models that had a many to many relationship and I used this approach which worked perfectly.

I had to show a field of tags while adding/editing user. The field was added, but I lost the functionality of password hashing. So now, I've to use UserAdmin as suggested here

Actually, I'm trying this:

class CustomUserAdmin(UserAdmin):
    form = UserForm

which is not working with the existing form i.e. the tags field is not displayed at all. What I need to change?

Upvotes: 0

Views: 223

Answers (1)

Ari
Ari

Reputation: 3127

Try to create inlines. Inlines let you show and customize related object in admin panel.

Upvotes: 1

Related Questions