Fixed #16257 -- Added new ModelAdmin.get_list_display_links() method to allow for the dynamic display of links on the admin changelist. Thanks to graveyboat for the suggestion and initial patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17037 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Julien Phalip 2011-10-26 12:19:18 +00:00
parent a05c70fae1
commit 9796f69533
6 changed files with 94 additions and 24 deletions

View file

@ -1044,6 +1044,16 @@ templates used by the :class:`ModelAdmin` views:
displayed on the changelist view as described above in the
:attr:`ModelAdmin.list_display` section.
.. method:: ModelAdmin.get_list_display_links(self, request, list_display)
.. versionadded:: 1.4
The ``get_list_display_links`` method is given the ``HttpRequest`` and
the ``list`` or ``tuple`` returned by :meth:`ModelAdmin.get_list_display`.
It is expected to return a ``list`` or ``tuple`` of field names on the
changelist that will be linked to the change view, as described in the
:attr:`ModelAdmin.list_display_links` section.
.. method:: ModelAdmin.get_urls(self)
The ``get_urls`` method on a ``ModelAdmin`` returns the URLs to be used for