Fixed #14206 - dynamic list_display support in admin

Thanks to gabejackson for the suggestion, and to cyrus for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16340 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Luke Plant 2011-06-08 22:53:55 +00:00
parent 45e55b9143
commit 207e3ed9d5
3 changed files with 96 additions and 24 deletions

View file

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