On Apr 22, 9:24 pm, "Nicolas E. Lara G." <[EMAIL PROTECTED]>
wrote:
> So a QuerySet might be:
> >>> Students.objects.all().aggregate(height__avg='average_height')
> {'average_height' : 1.43}

This looks really great, but one thing that initially confused me was
the ordering of the arguments - it seems strange to ask for
(height_avg = 'average_height') and then get back {'average_height':
1.43} - the name in the output is in a different place from the name
in the input.

Have you considered syntax that looks like this instead? :
>>> Students.objects.all().aggregate({'average_height': 'height__avg})
> {'average_height' : 1.43}

That way the API feels like you are passing in an example of the data
structure you want, and Django is using your example and filling in
the gaps for you.

Cheers,

Simon Willison
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to