Re: [GSoC] Aggregate Support to the ORM

2008-04-25 Thread Honza Král
I would love to see something like AggregateModel returned from .values().annotate() it would work like: for m in Model.objects.values( 'name', 'place' ).annotate( event__count='number_or_events' ) # the basic data would be available right away print m['number_or_events'], m['place'],

Re: [GSoC] Aggregate Support to the ORM

2008-04-24 Thread Russell Keith-Magee
On Thu, Apr 24, 2008 at 10:14 PM, Nicolas Lara <[EMAIL PROTECTED]> wrote: > On the ıssue of returnıng model objects ınstead of values > (dıctıonarıes): I belıeve the problem wıth that ıs ınconsıstency, > sınce when usıng values to restrıct the elements that are grouped > together you cannot

Re: [GSoC] Aggregate Support to the ORM

2008-04-24 Thread Nicolas Lara
Sorry ıf thıs goes on the wrong thread. I am wrıttıng at the moment from turkey, where google groups ıs blocked. In short: I belıeve Malcom's reply says ıt all except for the fact that the 'havıng' clause would be expressed wıth a fılter modıfıer. The ORM would take care of puttıng the requested

Re: [GSoC] Aggregate Support to the ORM

2008-04-23 Thread Malcolm Tredinnick
On Wed, 2008-04-23 at 07:50 -0700, Eratothene wrote: > It looks that API lacks support for SQL HAVING clause, this one should > be distinct from filter, GROUP BY without HAVING is often useless. > > Consider adding it to api (something like >

Re: [GSoC] Aggregate Support to the ORM

2008-04-23 Thread Eratothene
It looks that API lacks support for SQL HAVING clause, this one should be distinct from filter, GROUP BY without HAVING is often useless. Consider adding it to api (something like Model.objects.aggregate(height__sum).having(sex='M')) Also do not forget to add HAVING clause to .extra() method.

Re: [GSoC] Aggregate Support to the ORM

2008-04-22 Thread Rajeev J Sebastian
Hi Nicolas, First, congratulations on your GSOC selection :) I would to know if you will be building some way to use PG custom aggregates. I have so far one custom aggregate and I wonder how it could work with this scheme. Specifically, will there be some way to create new aggregate predicates

Re: [GSoC] Aggregate Support to the ORM

2008-04-22 Thread Matthias Kestenholz
Hi. this is very exciting! I've one suggestion/question though. On Tue, 2008-04-22 at 13:24 -0700, Nicolas E. Lara G. wrote: > with the possibility of using non-keyword arguments for un-aliased > aggregation, in which case the 'alias' would be automatically created > from the query made: > >>>

[GSoC] Aggregate Support to the ORM

2008-04-22 Thread Nicolas E. Lara G.
Hello, I have been selected to implement Aggregate support in the Django ORM as a project for Google Summer of Code 2008 =) My mentor for this project is Russell Keith-Magee. I am very happy with both being selected (of course :p) and, in general, with all the projects that were selected for