In Django admin, how to filter users by group?
问题 It gives you filter by staff status and superuser status, but what about groups? 回答1: Since version 1.3 it can be done using this: list_filter = ('groups__name') Of course as @S.Lott explains you must register your customized class in the admin.py file: from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User class MyUserAdmin(UserAdmin): list_filter = UserAdmin.list_filter + ('groups__name',) admin.site.unregister(User)