summaryrefslogtreecommitdiff
path: root/docs/ref
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:19:25 -0500
commitedec3e59a33ae4f456194c29630fd601213eee2f (patch)
tree621ecc6e893446793589b7d513ea39e005ccbf53 /docs/ref
parentfea599d2a288112d566b798a48615dcd1c6e1b87 (diff)
[5.2.x] Fixed #36686 -- Clarified Meta.ordering is ignored in GROUP BY queries.
Backport of 7e765a68598b2b798e49bf1f4b431a7bcac085a4 from main.
Diffstat (limited to 'docs/ref')
-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 3433d0730f..62064d4f24 100644
--- a/docs/ref/models/options.txt
+++ b/docs/ref/models/options.txt
@@ -309,6 +309,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