summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorJulien Phalip <jphalip@gmail.com>2012-11-25 20:39:23 +0100
committerJulien Phalip <jphalip@gmail.com>2012-11-25 20:43:18 +0100
commit22ca5bab95d65d0fdec0b6914f9ab96795cfe138 (patch)
tree7e9cea02c1edafc37046354a5de0497a163e971c /docs/ref
parent02ab5d180eded836fd258f59908c994ce1fec61d (diff)
[1.5.x] Fixed #17646 -- Added a get_list_filter() method to ModelAdmin. Thanks to rasca for the suggestion and to mateusgondim for the patch.
Backport of ae206d78f6d991e
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/contrib/admin/index.txt12
1 files changed, 10 insertions, 2 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
index 38668a0a2c..6f79e97a3c 100644
--- a/docs/ref/contrib/admin/index.txt
+++ b/docs/ref/contrib/admin/index.txt
@@ -570,8 +570,8 @@ subclass::
.. image:: _images/users_changelist.png
- ``list_filter`` should be a list of elements, where each element should be
- of one of the following types:
+ ``list_filter`` should be a list or tuple of elements, where each element
+ should be of one of the following types:
* a field name, where the specified field should be either a
``BooleanField``, ``CharField``, ``DateField``, ``DateTimeField``,
@@ -1076,6 +1076,14 @@ templates used by the :class:`ModelAdmin` views:
changelist that will be linked to the change view, as described in the
:attr:`ModelAdmin.list_display_links` section.
+.. method:: ModelAdmin.get_list_filter(self, request)
+
+ .. versionadded:: 1.5
+
+ The ``get_list_filter`` method is given the ``HttpRequest`` and is expected
+ to return the same kind of sequence type as for the
+ :attr:`~ModelAdmin.list_filter` attribute.
+
.. method:: ModelAdmin.get_inline_instances(self, request, obj=None)
.. versionadded:: 1.5