Custom Aggregate Objects

2009-02-02 Thread nsitarz
Hey, Back when the ORM aggregate support was a patch in trac I used to create custom aggregate objects that looked like this: class Date(Aggregate): pass class DateHour(Aggregate): def __init__(self, lookup): super(DateHour, self).__init__(lookup) self.sql_template = '(

Re: Custom Aggregate Objects

2009-02-03 Thread nsitarz
Wow that was fast and is exactly what I was looking for :D Thanks, Nick. On Feb 3, 4:04 am, Russell Keith-Magee wrote: > On Tue, Feb 3, 2009 at 8:34 PM, Russell Keith-Magee > > > > wrote: > > On Tue, Feb 3, 2009 at 11:16 AM, alex.gay...@gmail.com > > wrote: > &

Re: Custom Aggregate Objects

2009-02-03 Thread nsitarz
Well I've successfully subclassed the base aggregate class from Russell above and it works as expected, however when I try and group by my new aggregate field I get a FieldError. This makes sense to me because when I call values on the queryset the new field hasn't been created yet. Here's an exa