Ticket #15746: 15746_list_filter_doc.diff

File 15746_list_filter_doc.diff, 1.1 KB (added by julien, 4 years ago)
  • docs/ref/contrib/admin/index.txt

    diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
    index c28dc8b..1291085 100644
    a b subclass:: 
    531531            list_display = ('username', 'email', 'first_name', 'last_name', 'is_staff')
    532532            list_filter = ('is_staff', 'is_superuser')
    533533
    534     Fields in ``list_filter`` can also span relations using the ``__`` lookup::
    535 
    536         class UserAdminWithLookup(UserAdmin):
    537             list_filter = ('groups__name')
    538 
    539534    The above code results in an admin change list page that looks like this:
    540535
    541536        .. image:: _images/users_changelist.png
    542537
    543538    (This example also has ``search_fields`` defined. See below.)
    544539
     540    .. versionadded:: 1.3
     541
     542    Since version 1.3, fields in ``list_filter`` can also span relations using the ``__`` lookup::
     543
     544        class UserAdminWithLookup(UserAdmin):
     545            list_filter = ('groups__name')
     546
    545547.. attribute:: ModelAdmin.list_per_page
    546548
    547549    Set ``list_per_page`` to control how many items appear on each paginated
Back to Top