views:

277

answers:

1

The django admin's User management gives us easy access to setting a User's group allegiances via the list for picking the Groups. This is the ManyToMany relationship default widget for assignment. And for the most part that's nice for User creation from the get go.

However, say I have a huge number of users and groups...I'd like the chance to view and manage group membership by clicking on the Group in the admin and see all the members in a similar picker (or via the horizontal widget).

Is there a builtin django method/trick to show ManyToMany relations in "reverse?"

Setting group assignment is fine from the User adminform on User creation. But this is can be big pain to find and manage once users and groups are well established.

I guess the workaround is to make my own view to show group members, I just wanted to see if there was some trick I could do with inlines or something in the admin.

A: 

Try to use this snippet. It's customisation example of contrib.auth app admin part.

ramusus
thanks, that trick worked perfectly!
dmyung