diff options
| author | Klemens Mantzos <klemens@fetzig.at> | 2014-01-23 03:13:59 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-02-14 19:53:44 -0500 |
| commit | f683cb90bea2afbe0ef4c011acd4ab590c37410d (patch) | |
| tree | fdb2b7528378f60979fd5e32a27ae80594626962 /docs/ref | |
| parent | 0242134d32aa99a54442211ed05576b7061866d1 (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/ref')
| -rw-r--r-- | docs/ref/contrib/admin/index.txt | 8 |
1 files changed, 8 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 |
