mirror of
https://github.com/django/django.git
synced 2025-07-05 18:29:11 +00:00
[1.3.X] Fixed #15746. Clarified updated list_filter documentation.
Backport of r16010 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.3.X@16011 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
e5aa2bdcec
commit
05054aba76
@ -531,17 +531,19 @@ subclass::
|
||||
list_display = ('username', 'email', 'first_name', 'last_name', 'is_staff')
|
||||
list_filter = ('is_staff', 'is_superuser')
|
||||
|
||||
Fields in ``list_filter`` can also span relations using the ``__`` lookup::
|
||||
|
||||
class UserAdminWithLookup(UserAdmin):
|
||||
list_filter = ('groups__name')
|
||||
|
||||
The above code results in an admin change list page that looks like this:
|
||||
|
||||
.. image:: _images/users_changelist.png
|
||||
|
||||
(This example also has ``search_fields`` defined. See below.)
|
||||
|
||||
.. versionadded:: 1.3
|
||||
|
||||
Fields in ``list_filter`` can also span relations using the ``__`` lookup::
|
||||
|
||||
class UserAdminWithLookup(UserAdmin):
|
||||
list_filter = ('groups__name')
|
||||
|
||||
.. attribute:: ModelAdmin.list_per_page
|
||||
|
||||
Set ``list_per_page`` to control how many items appear on each paginated
|
||||
|
Loading…
x
Reference in New Issue
Block a user