summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJani Tiainen <jani@tiainen.cc>2019-03-19 17:51:35 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-03-24 20:43:56 +0100
commit044cc544203fdcf2601ff200547ecae2e51a5db5 (patch)
tree7d49cb5ff82b7368e39456752ceab3ec8bc480bd /docs
parentea60b7bc7464808e34e3cb0aac04455fdd8545eb (diff)
Fixed #30259 -- Added support for admin_order_field attribute on properties in ModelAdmin.list_display.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/contrib/admin/index.txt6
-rw-r--r--docs/releases/3.0.txt3
2 files changed, 6 insertions, 3 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
index b4fa8c5035..93679c46fd 100644
--- a/docs/ref/contrib/admin/index.txt
+++ b/docs/ref/contrib/admin/index.txt
@@ -754,8 +754,9 @@ subclass::
* Elements of ``list_display`` can also be properties. Please note however,
that due to the way properties work in Python, setting
- ``short_description`` on a property is only possible when using the
- ``property()`` function and **not** with the ``@property`` decorator.
+ ``short_description`` or ``admin_order_field`` on a property is only
+ possible when using the ``property()`` function and **not** with the
+ ``@property`` decorator.
For example::
@@ -766,6 +767,7 @@ subclass::
def my_property(self):
return self.first_name + ' ' + self.last_name
my_property.short_description = "Full name of the person"
+ my_property.admin_order_field = 'last_name'
full_name = property(my_property)
diff --git a/docs/releases/3.0.txt b/docs/releases/3.0.txt
index 69925e7fca..47fa80d30b 100644
--- a/docs/releases/3.0.txt
+++ b/docs/releases/3.0.txt
@@ -44,7 +44,8 @@ Minor features
:mod:`django.contrib.admin`
~~~~~~~~~~~~~~~~~~~~~~~~~~~
-* ...
+* Added support for ``admin_order_field`` attribute on properties in
+ :attr:`.ModelAdmin.list_display`.
:mod:`django.contrib.admindocs`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~