The prefetch_related call removes any need for the explicit call to all. The current method is suboptimal since two queries are performed: the all and the prefetch_related.
https://github.com/compserv/hknweb/blob/master/hknweb/candidate/views/officer_portal.py#L186
Also highkey, this entire section could probably be stuck into a chain of values into a count aggregation.