Re: [Feature Request] Shorthand syntax for filtering aggregations

2017-04-12 Thread Ian Foote
Hi Tom, I really like the look of Count('emails').filter(unread=False) in the annotate call. Ian On 12/04/17 21:35, Tom Forbes wrote: > Hello, > At the Djangocon sprints I wanted to add support for a postgres specific > syntax for filtering aggregations, which is quite simple: MAX(something) > F

[Feature Request] Shorthand syntax for filtering aggregations

2017-04-12 Thread Tom Forbes
Hello, At the Djangocon sprints I wanted to add support for a postgres specific syntax for filtering aggregations, which is quite simple: MAX(something) FILTER (WHERE x=1). During this the sprints I was told that it would be good to support this for all databases, and it can be done using the CASE