select foo, count(*) from bar group by foo in django
Every once in a while you need some old fashion SQL style queries in django. This is a common one for reporting and aggregation. Its fairly easy to replicate in a queryset. Say I wanted to get the authors and the number of articles they have written going back to the beginning of 2009 to the present: The result: