summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-07-25 06:21:39 -0400
committerTim Graham <timograham@gmail.com>2016-07-25 06:25:01 -0400
commitbdeec1d2aeb74d52cae8e1f9a334eefb5199f07e (patch)
tree64dec6565350009ab4f58cdc7da4a9a86991b0f4
parentcaec27f87c56442d4512cb6dd9e6c26fd8d4414a (diff)
[1.9.x] Fixed #26925 -- Linked aggregation ordering topic from Meta.ordering docs.
Backport of 3aaf6cf0f3288986c4ce56defea26420f8a48534 from master
-rw-r--r--docs/ref/models/options.txt3
-rw-r--r--docs/topics/db/aggregation.txt2
2 files changed, 5 insertions, 0 deletions
diff --git a/docs/ref/models/options.txt b/docs/ref/models/options.txt
index 8b77c7101d..3650d20b0a 100644
--- a/docs/ref/models/options.txt
+++ b/docs/ref/models/options.txt
@@ -258,6 +258,9 @@ Django quotes column and table names behind the scenes.
ordering = ['-pub_date', 'author']
+ Default ordering also affects :ref:`aggregation queries
+ <aggregation-ordering-interaction>`.
+
.. warning::
Ordering is not a free operation. Each field you add to the ordering
diff --git a/docs/topics/db/aggregation.txt b/docs/topics/db/aggregation.txt
index ec11fcf4ee..1287f1ee5b 100644
--- a/docs/topics/db/aggregation.txt
+++ b/docs/topics/db/aggregation.txt
@@ -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
include the aggregate column.
+.. _aggregation-ordering-interaction:
+
Interaction with default ordering or ``order_by()``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~