freedomsponsors/www.freedomsponsors.org — pull request #120 by henriquebastos (2012-12-30 16:51:54+00:00)
Title: Statistics refactory

This PR:

1. Eliminates custom SQLs for stats;
2. Reduces stats from 16 queries to 5. (middleware+stats are now 7 in total);
3. Adds tests for every stats data;
4. Uses [django-aggregate-if](pypi.python.org/pypi/django-aggregate-if/) to simplify queries;