mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #13312 -- Allowed specifying the order of null fields in queries.
Thanks Mariusz Felisiak for finishing the patch.
This commit is contained in:
parent
82fd779af5
commit
47ef8f31f3
5 changed files with 105 additions and 13 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue