Code

Ticket #16309: 16309-documentation-admin-list_filter.2.diff

File 16309-documentation-admin-list_filter.2.diff, 1.7 KB (added by akaihola, 3 years ago)

Mark both SimpleListFilter and FieldListFilter as "new in Django 1.4" instead of marking all of list_filter changed

Line 
1diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
2index c0ff3c6..37849e4 100644
3--- a/docs/ref/contrib/admin/index.txt
4+++ b/docs/ref/contrib/admin/index.txt
5@@ -553,8 +553,6 @@ subclass::
6 
7 .. attribute:: ModelAdmin.list_filter
8 
9-    .. versionchanged:: 1.4
10-
11     Set ``list_filter`` to activate filters in the right sidebar of the change
12     list page of the admin, as illustrated in the following screenshot:
13 
14@@ -578,7 +576,9 @@ subclass::
15               class PersonAdmin(UserAdmin):
16                   list_filter = ('company__name',)
17 
18-        * a class inheriting from :mod:`django.contrib.admin.SimpleListFilter`,
19+        * .. versionadded:: 1.4
20+
21+          a class inheriting from :mod:`django.contrib.admin.SimpleListFilter`,
22           which you need to provide the ``title`` and ``parameter_name``
23           attributes to and override the ``lookups`` and ``queryset`` methods,
24           e.g.::
25@@ -592,7 +592,7 @@ subclass::
26                    title = _('decade born')
27 
28                    # Parameter for the filter that will be used in the URL query.
29-                   parameter_name = 'decade'
30+t                   parameter_name = 'decade'
31 
32                    def lookups(self, request, model_admin):
33                        """
34@@ -661,7 +661,9 @@ subclass::
35                                         birthday__year__lte=1999).exists():
36                               yield ('90s', _('in the nineties'))
37 
38-        * a tuple, where the first element is a field name and the second
39+        * .. versionadded:: 1.4
40+
41+          a tuple, where the first element is a field name and the second
42           element is a class inheriting from
43           :mod:`django.contrib.admin.FieldListFilter`, for example::
44