#32811: Annotate removes Meta.ordering
-------------------------------------+-------------------------------------
     Reporter:  pirelle              |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  3.2
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:  invalid
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Comment (by Carsten Fuchs):

 Replying to [comment:2 Peter Law]:
 > My use-case was similar to the one mentioned here, however I was loading
 full models (with a similar count annotation) and not any form of
 `.values()`.
 > […]
 > What I've seen of the reasoning for the deprecation appears to be
 related specifically to `.values()` queries, and then really to cases
 where that is used to create a grouping ''of the main queried table''
 (where the user is probably aware that that's what they're doing). However
 the behaviour change impacts ''all'' querysets (including those which
 return full models) and the behaviour here is ''not'' intending to create
 a grouping of things on the main table, but rather of a related table for
 the purposes of counting (where the user is unlikely to be aware that a
 group-by is the result).

 I concur with Peter: The place where this is currently documented, namely
 as linked by Mariusz in section
 [https://docs.djangoproject.com/en/5.2/topics/db/aggregation/#interaction-
 with-order-by Interaction with order_by()], is a subsection of
 [https://docs.djangoproject.com/en/5.2/topics/db/aggregation/#values
 values()], suggesting that this is relevant only in the context when
 `values()` and `order_by()` are used together. For me, too, it was not
 obvious that this would apply to broader cases without `values()` as well.

 Therefore, I would like to request that the documentation is clarified
 about this.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/32811#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019a06ea68bf-3068f1c3-25c3-464e-a3b5-23b2d130097b-000000%40eu-central-1.amazonses.com.

Reply via email to