#14357: Prevent innapropriate order-based grouping on values+annotate queries
-----------------------------+----------------------------------------------
 Reporter:  outofculture     |       Owner:            
   Status:  new              |   Milestone:  2.0       
Component:  ORM aggregation  |     Version:            
 Keywords:                   |       Stage:  Unreviewed
Has_patch:  0                |  
-----------------------------+----------------------------------------------
 {{{
 class Foo(models.Model):
     name = models.TextField()
     type = models.TextField()

     class Meta:
         ordering = ["name",]

 Foo.objects.all().values("type").annotate(models.Count("name"))
 }}}
 The above code fails to generate the expected result without adding
 {{{.order_by()}}} to the query set.

 Ticket #10574 called this fixed with documentation, but indicated a proper
 fix would be preferred once backwards compatibility wasn't an issue.  Lest
 this fall off the radar for being closed, I am putting this ticket in for
 2.0.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14357>
Django <http://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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to