Use aggregation (GROUP BY) to reduce db calls
Use aggregation (GROUP BY) to reduce db calls

`QuerySet.values_list(key).aggregate(attr=Count(key))` performs a
`SELECT COUNT(key) ... GROUP BY key` query to the database, allowing us to
fetch all needed information with one shot instead of redundant calls.
I know 3 less calls (4 -> 1) is not much, but we should follow a somewhat
reasonable practice.

pycontw/pycontw2016,pycontw/pycontw2016,pycontw/pycontw2016,pycontw/pycontw2016