mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #24417 -- Added ModelAdmin.get_list_select_related()
This commit is contained in:
parent
8d90489fe0
commit
35b3158d52
4 changed files with 47 additions and 5 deletions
|
@ -920,6 +920,9 @@ subclass::
|
|||
|
||||
will call ``select_related('author', 'category')``.
|
||||
|
||||
If you need to specify a dynamic value based on the request, you can
|
||||
implement a :meth:`~ModelAdmin.get_list_select_related` method.
|
||||
|
||||
.. attribute:: ModelAdmin.ordering
|
||||
|
||||
Set ``ordering`` to specify how lists of objects should be ordered in the
|
||||
|
@ -932,7 +935,6 @@ subclass::
|
|||
If you need to specify a dynamic order (for example depending on user or
|
||||
language) you can implement a :meth:`~ModelAdmin.get_ordering` method.
|
||||
|
||||
|
||||
.. attribute:: ModelAdmin.paginator
|
||||
|
||||
The paginator class to be used for pagination. By default,
|
||||
|
@ -1366,6 +1368,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_list_select_related(request)
|
||||
|
||||
.. versionadded:: 1.9
|
||||
|
||||
The ``get_list_select_related`` method is given the ``HttpRequest`` and
|
||||
should return a boolean or list as :attr:`ModelAdmin.list_select_related`
|
||||
does.
|
||||
|
||||
.. method:: ModelAdmin.get_search_fields(request)
|
||||
|
||||
The ``get_search_fields`` method is given the ``HttpRequest`` and is expected
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue