summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorKlemens Mantzos <klemens@fetzig.at>2014-01-23 03:13:59 +0100
committerTim Graham <timograham@gmail.com>2014-02-14 19:53:44 -0500
commitf683cb90bea2afbe0ef4c011acd4ab590c37410d (patch)
treefdb2b7528378f60979fd5e32a27ae80594626962 /docs
parent0242134d32aa99a54442211ed05576b7061866d1 (diff)
Fixed #21924 -- Added the ability to specify a reverse order for admin_order_field.
Thanks Klemens Mantzos for the report and initial patch.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/contrib/admin/index.txt8
-rw-r--r--docs/releases/1.7.txt4
2 files changed, 12 insertions, 0 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
index 28de1aa612..e44ecc8e55 100644
--- a/docs/ref/contrib/admin/index.txt
+++ b/docs/ref/contrib/admin/index.txt
@@ -664,6 +664,14 @@ subclass::
The above will tell Django to order by the ``first_name`` field when
trying to sort by ``colored_first_name`` in the admin.
+ .. versionadded:: 1.7
+
+ To indicate descending order with ``admin_model_field`` you can use a
+ hyphen prefix on the field name. Using the above example, this would
+ look like::
+
+ colored_first_name.admin_order_field = '-first_name'
+
* 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
diff --git a/docs/releases/1.7.txt b/docs/releases/1.7.txt
index d2f1c39ec3..8e9ebe72a1 100644
--- a/docs/releases/1.7.txt
+++ b/docs/releases/1.7.txt
@@ -292,6 +292,10 @@ Minor features
<django.contrib.admin.ModelAdmin.view_on_site>` to control whether or not to
display the "View on site" link.
+* You can specify a descending ordering for a :attr:`ModelAdmin.list_display
+ <django.contrib.admin.ModelAdmin.list_display>` value by prefixing the
+ ``admin_order_field`` value with a hyphen.
+
:mod:`django.contrib.auth`
^^^^^^^^^^^^^^^^^^^^^^^^^^