summaryrefslogtreecommitdiff
path: root/docs/releases/3.2.txt
diff options
context:
space:
mode:
authorNick Pope <nick.pope@flightdataservices.com>2021-01-13 16:19:22 +0000
committerGitHub <noreply@github.com>2021-01-13 17:19:22 +0100
commit920448539631b52dcee53bd32a880abbc9de18bd (patch)
tree03dd52fd206088302de11e0b485b420726718a4a /docs/releases/3.2.txt
parent83fcfc9ec8610540948815e127101f1206562ead (diff)
Fixed #16117 -- Added decorators for admin action and display functions.
Refs #25134, #32099.
Diffstat (limited to 'docs/releases/3.2.txt')
-rw-r--r--docs/releases/3.2.txt22
1 files changed, 22 insertions, 0 deletions
diff --git a/docs/releases/3.2.txt b/docs/releases/3.2.txt
index 57ab1baf34..66607916e0 100644
--- a/docs/releases/3.2.txt
+++ b/docs/releases/3.2.txt
@@ -141,6 +141,28 @@ Django </topics/cache>`.
.. _pymemcache: https://pypi.org/project/pymemcache/
+New decorators for the admin site
+---------------------------------
+
+The new :func:`~django.contrib.admin.display` decorator allows for easily
+adding options to custom display functions that can be used with
+:attr:`~django.contrib.admin.ModelAdmin.list_display` or
+:attr:`~django.contrib.admin.ModelAdmin.readonly_fields`.
+
+Likewise, the new :func:`~django.contrib.admin.action` decorator allows for
+easily adding options to action functions that can be used with
+:attr:`~django.contrib.admin.ModelAdmin.actions`.
+
+Using the ``@display`` decorator has the advantage that it is now
+possible to use the ``@property`` decorator when needing to specify attributes
+on the custom method. Prior to this it was necessary to use the ``property()``
+function instead after assigning the required attributes to the method.
+
+Using decorators has the advantage that these options are more discoverable as
+they can be suggested by completion utilities in code editors. They are merely
+a convenience and still set the same attributes on the functions under the
+hood.
+
Minor features
--------------