#3566: Proposal: ORM aggregation support
-------------------------------------------------+--------------------------
   Reporter:  Honza Král <[EMAIL PROTECTED]>  |                Owner:  adrian   
             
     Status:  new                                |            Component:  
Database wrapper      
    Version:  SVN                                |           Resolution:        
                
   Keywords:  orm aggregation group by           |                Stage:  
Design decision needed
  Has_patch:  0                                  |           Needs_docs:  0     
                
Needs_tests:  0                                  |   Needs_better_patch:  0     
                
-------------------------------------------------+--------------------------
Comment (by Ciantic):

 {{{
 either it will be the whole object, or just an id, having a lazy object
 doesn't seem to have any effect here
 }}}
 Returning just an ID is more harmful than returning object. When you
 return just the ID the people who needs the object is facing frustrating
 problem, fetching those objects externally. I suggest we use object, and
 those who need ID just uses the object.id to get it (notice: in django one
 shouldn't change the id fieldname, I've learnt, same way they shouldn't
 change the primarykey type... even if it is possible, there is stuff that
 simply does not work after changing it).
 
 {{{
 nice, but what field should be first in your example? name, SUM( pay ) or
 AVG( pay ) ??
 }}}
 name is first, then comes sub(pay) with descending in place and finally
 avg(pay), same way as in normal order_by, the leftmost has biggest
 priority.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/3566#comment:8>
Django Code <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