#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 Honza Král <[EMAIL PROTECTED]>):
Replying to [comment:8 Ciantic]:
>
> {{{
> 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.
and what if I want to sort on sum( pay ), name, sum( other_field ), that
wouldn't work in your syntax, since order_by( sum='pay', group_by='name',
sum='other_field' ) is a syntax error....
I would like to avoid things like order_by( 'sum(pay)',
'avg(other_field)', 'name' ), but so far its the only way I can think
of...
--
Ticket URL: <http://code.djangoproject.com/ticket/3566#comment:9>
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
-~----------~----~----~----~------~----~------~--~---