diff options
| author | Julien Phalip <jphalip@gmail.com> | 2011-10-26 12:19:18 +0000 |
|---|---|---|
| committer | Julien Phalip <jphalip@gmail.com> | 2011-10-26 12:19:18 +0000 |
| commit | 9796f69533320171bf22d769d6e4ab3f5a45aac1 (patch) | |
| tree | da65072a8743d2e0f069b0c047201b0d31b463ed /docs | |
| parent | a05c70fae133d2ece1bcf1ce6f152a6a70ab8cf2 (diff) | |
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
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/contrib/admin/index.txt | 10 | ||||
| -rw-r--r-- | docs/releases/1.4.txt | 13 |
2 files changed, 20 insertions, 3 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index 1e283151b0..2590243144 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -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 diff --git a/docs/releases/1.4.txt b/docs/releases/1.4.txt index a11aa41ad5..6fb6f183cb 100644 --- a/docs/releases/1.4.txt +++ b/docs/releases/1.4.txt @@ -124,13 +124,20 @@ to work similarly to how desktop GUIs do it. The new hook :meth:`~django.contrib.admin.ModelAdmin.get_ordering` for specifying the ordering dynamically (e.g. depending on the request) has also been added. -``ModelAdmin.save_related()`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +New ``ModelAdmin`` methods +~~~~~~~~~~~~~~~~~~~~~~~~~~ -A new :meth:`~django.contrib.admin.ModelAdmin.save_related` hook was added to +A new :meth:`~django.contrib.admin.ModelAdmin.save_related` method was added to :mod:`~django.contrib.admin.ModelAdmin` to ease the customization of how related objects are saved in the admin. +Two other new methods, +:meth:`~django.contrib.admin.ModelAdmin.get_list_display` and +:meth:`~django.contrib.admin.ModelAdmin.get_list_display_links` +were added to :class:`~django.contrib.admin.ModelAdmin` to enable the dynamic +customization of fields and links to display on the admin +change list. + Admin inlines respect user permissions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
