diff options
| author | Kasyap Pentamaraju <vpentamaraju@webmd.net> | 2025-10-25 19:23:40 +0530 |
|---|---|---|
| committer | Jacob Walls <jacobtylerwalls@gmail.com> | 2025-11-13 11:19:05 -0500 |
| commit | 37b5dced864f0d9e1ac2c1e3ca58a947ee850c71 (patch) | |
| tree | f0f3e475ad352ee7aeb4da032b7bc79e6871a370 /docs/ref | |
| parent | 5ae8659cb5beb9e4bea36a1c1b2e443bff4f3873 (diff) | |
[6.0.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.txt | 6 |
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 |
