summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorYohann Gabory <boblefrag@gmail.com>2016-07-27 15:17:05 +0200
committerTim Graham <timograham@gmail.com>2016-12-08 09:54:07 -0500
commit47ef8f31f30a2b1920f82494d729c285565867dd (patch)
tree90b1a57169336355e819e2fcba189f504eff1a7b /docs
parent82fd779af5bce50cb24adc3ed7b7811da369f6a2 (diff)
Fixed #13312 -- Allowed specifying the order of null fields in queries.
Thanks Mariusz Felisiak for finishing the patch.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/expressions.txt16
-rw-r--r--docs/releases/1.11.txt5
2 files changed, 19 insertions, 2 deletions
diff --git a/docs/ref/models/expressions.txt b/docs/ref/models/expressions.txt
index 91786b3622..e46df22f98 100644
--- a/docs/ref/models/expressions.txt
+++ b/docs/ref/models/expressions.txt
@@ -560,14 +560,26 @@ calling the appropriate methods on the wrapped expression.
nested expressions. ``F()`` objects, in particular, hold a reference
to a column.
- .. method:: asc()
+ .. method:: asc(nulls_first=False, nulls_last=False)
Returns the expression ready to be sorted in ascending order.
- .. method:: desc()
+ ``nulls_first`` and ``nulls_last`` define how null values are sorted.
+
+ .. versionchanged:: 1.11
+
+ The ``nulls_last`` and ``nulls_first`` parameters were added.
+
+ .. method:: desc(nulls_first=False, nulls_last=False)
Returns the expression ready to be sorted in descending order.
+ ``nulls_first`` and ``nulls_last`` define how null values are sorted.
+
+ .. versionchanged:: 1.11
+
+ The ``nulls_first`` and ``nulls_last`` parameters were added.
+
.. method:: reverse_ordering()
Returns ``self`` with any modifications required to reverse the sort
diff --git a/docs/releases/1.11.txt b/docs/releases/1.11.txt
index 59b7fb54f9..2035588af6 100644
--- a/docs/releases/1.11.txt
+++ b/docs/releases/1.11.txt
@@ -337,6 +337,11 @@ Models
* You can now use the ``unique=True`` option with
:class:`~django.db.models.FileField`.
+* Added the ``nulls_first`` and ``nulls_last`` parameters to
+ :class:`Expression.asc() <django.db.models.Expression.asc>` and
+ :meth:`~django.db.models.Expression.desc` to control
+ the ordering of null values.
+
Requests and Responses
~~~~~~~~~~~~~~~~~~~~~~