[1.9.x] Fixed #26925 -- Linked aggregation ordering topic from Meta.ordering docs.
Backport of 3aaf6cf0f3288986c4ce56defea26420f8a48534 from master
This commit is contained in:
parent
caec27f87c
commit
bdeec1d2ae
@ -258,6 +258,9 @@ Django quotes column and table names behind the scenes.
|
|||||||
|
|
||||||
ordering = ['-pub_date', 'author']
|
ordering = ['-pub_date', 'author']
|
||||||
|
|
||||||
|
Default ordering also affects :ref:`aggregation queries
|
||||||
|
<aggregation-ordering-interaction>`.
|
||||||
|
|
||||||
.. warning::
|
.. warning::
|
||||||
|
|
||||||
Ordering is not a free operation. Each field you add to the ordering
|
Ordering is not a free operation. Each field you add to the ordering
|
||||||
|
@ -479,6 +479,8 @@ will be automatically added to the result set. However, if the ``values()``
|
|||||||
clause is applied after the ``annotate()`` clause, you need to explicitly
|
clause is applied after the ``annotate()`` clause, you need to explicitly
|
||||||
include the aggregate column.
|
include the aggregate column.
|
||||||
|
|
||||||
|
.. _aggregation-ordering-interaction:
|
||||||
|
|
||||||
Interaction with default ordering or ``order_by()``
|
Interaction with default ordering or ``order_by()``
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user