#36686: Update documentation on 'never removes' ordering.
-----------------------+-----------------------------------------
     Reporter:  wutje  |                     Type:  Bug
       Status:  new    |                Component:  Documentation
      Version:  5.2    |                 Severity:  Normal
     Keywords:         |             Triage Stage:  Unreviewed
    Has patch:  0      |      Needs documentation:  0
  Needs tests:  0      |  Patch needs improvement:  0
Easy pickings:  0      |                    UI/UX:  0
-----------------------+-----------------------------------------
 Today I hunted an ordering bug. I have a model with {{{ordering =
 ['name']}}}

 And in a view I use:
 {{{queryset.annotate(used_by=Count('somerelation'))}}} which drops the
 order_by.

 However the documentation for a aggregation states:
 https://docs.djangoproject.com/en/5.2/topics/db/aggregation/ that:
 {{{Django never removes ordering constraints that you have specified}}}.

 But then I saw the changelog for version. 2.2. Which explicitly states:

 {{{A model’s Meta.ordering affecting GROUP BY queries (such as
 .annotate().values()) is a common source of confusion. Such queries now
 issue a deprecation warning with the advice to add an order_by() to retain
 the current query. Meta.ordering will be ignored in such queries starting
 in Django 3.1.}}}

 Where do I find this information in the current documentation? I think
 this information is currently missing.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36686>
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/0107019a16b6880c-8d0118f6-5357-40fb-a316-f870aaf94f05-000000%40eu-central-1.amazonses.com.

Reply via email to