#10113: aggregation annotations on related tables do not work with ordering on
field in different related table
----------------------------------------------------------+-----------------
 Reporter:  Koen Biermans <[email protected]>  |       Owner:  
nobody    
   Status:  new                                           |   Milestone:        
    
Component:  Database layer (models, ORM)                  |     Version:  1.0   
    
 Keywords:  aggregation                                   |       Stage:  
Unreviewed
Has_patch:  0                                             |  
----------------------------------------------------------+-----------------
 Using annotate on a related table in combination with ordering on a field
 from a different related table results in failures.

 There seem to be two problems:

 - the related orderby field is not included in the GROUP BY, which does
 not work on Postgres

 - the related table (of the orderby field) is included with an inner join,
 which comes after the left outer join of the annotation tables, which
 leads to incorrect results.

 This is easier to explain with an example, so I am including a diff that
 contains a small testcase demonstrating the problem.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/10113>
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