summaryrefslogtreecommitdiff
path: root/docs/topics/db/aggregation.txt
diff options
context:
space:
mode:
authorRamiro Morales <ramiro@users.noreply.github.com>2018-09-13 13:29:48 -0300
committerTim Graham <timograham@gmail.com>2018-09-13 12:29:48 -0400
commit1b1f64ee5a78cc217fead52cbae23114502cf564 (patch)
treec6baf64db6c3b7a381fd45639b189ef072e4a960 /docs/topics/db/aggregation.txt
parentc52ecbda615594750ae59b789313a29893950b3d (diff)
downloaddjango-1b1f64ee5a78cc217fead52cbae23114502cf564.tar.gz
Refs #14357 -- Deprecated Meta.ordering affecting GROUP BY queries.
Thanks Ramiro Morales for contributing to the patch.
Diffstat (limited to 'docs/topics/db/aggregation.txt')
-rw-r--r--docs/topics/db/aggregation.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/topics/db/aggregation.txt b/docs/topics/db/aggregation.txt
index 50a92a5dbe..c709c064a5 100644
--- a/docs/topics/db/aggregation.txt
+++ b/docs/topics/db/aggregation.txt
@@ -514,6 +514,13 @@ include the aggregate column.
Interaction with default ordering or ``order_by()``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.. deprecated:: 2.2
+
+ Starting in Django 3.1, the ordering from a model's ``Meta.ordering`` won't
+ be used in ``GROUP BY`` queries, such as ``.annotate().values()``. Since
+ Django 2.2, these queries issue a deprecation warning indicating to add an
+ explicit ``order_by()`` to the queryset to silence the warning.
+
Fields that are mentioned in the ``order_by()`` part of a queryset (or which
are used in the default ordering on a model) are used when selecting the
output data, even if they are not otherwise specified in the ``values()``