summaryrefslogtreecommitdiff
path: root/docs/ref/models
diff options
context:
space:
mode:
authorKasyap Pentamaraju <vpentamaraju@webmd.net>2025-10-25 19:23:40 +0530
committerJacob Walls <jacobtylerwalls@gmail.com>2025-11-13 11:18:02 -0500
commit7e765a68598b2b798e49bf1f4b431a7bcac085a4 (patch)
tree1faf900bab903553ce0148a8b0df2338420745d8 /docs/ref/models
parent3aba1fced8254435b947467739721ec6b4fb865c (diff)
Fixed #36686 -- Clarified Meta.ordering is ignored in GROUP BY queries.
Diffstat (limited to 'docs/ref/models')
-rw-r--r--docs/ref/models/options.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/ref/models/options.txt b/docs/ref/models/options.txt
index 0d27830fc9..e961e9cdfb 100644
--- a/docs/ref/models/options.txt
+++ b/docs/ref/models/options.txt
@@ -312,6 +312,12 @@ not be looking at your Django code. For example::
ordering = [F("author").asc(nulls_last=True)]
+.. admonition:: Default ordering and GROUP BY
+
+ In :ref:`GROUP BY queries <aggregation-ordering-interaction>` (for example,
+ those using :meth:`~.QuerySet.values` and :meth:`~.QuerySet.annotate`), the
+ default ordering is not applied.
+
.. warning::
Ordering is not a free operation. Each field you add to the ordering