diff options
| author | Loic Bistuer <loic.bistuer@sixmedia.com> | 2013-08-03 23:15:15 +0700 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-08-03 20:02:43 -0400 |
| commit | 0bcdcc7eb9ca2265cb83225257df65a8def3e14a (patch) | |
| tree | 68e7adb225c8a237d5edeaaf93b9b4a171117431 /docs | |
| parent | a0c58113b9de072482a5fee2a085218e67971b41 (diff) | |
Added ModelAdmin.get_search_fields.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/contrib/admin/index.txt | 8 | ||||
| -rw-r--r-- | docs/releases/1.7.txt | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index 946f915797..40ec514331 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -1233,6 +1233,14 @@ templates used by the :class:`ModelAdmin` views: to return the same kind of sequence type as for the :attr:`~ModelAdmin.list_filter` attribute. +.. method:: ModelAdmin.get_search_fields(self, request) + + .. versionadded:: 1.7 + + The ``get_search_fields`` method is given the ``HttpRequest`` and is expected + to return the same kind of sequence type as for the + :attr:`~ModelAdmin.search_fields` attribute. + .. method:: ModelAdmin.get_inline_instances(self, request, obj=None) .. versionadded:: 1.5 diff --git a/docs/releases/1.7.txt b/docs/releases/1.7.txt index c47a392dff..d21cb45428 100644 --- a/docs/releases/1.7.txt +++ b/docs/releases/1.7.txt @@ -110,6 +110,9 @@ Minor features or ``None`` for the key and the custom label as the value. The default blank option ``"----------"`` will be omitted in this case. +* The admin's search fields can now be customized per-request thanks to the new + :meth:`django.contrib.admin.ModelAdmin.get_search_fields` method. + Backwards incompatible changes in 1.7 ===================================== |
