ethanperez/t4k-rms — pull request #15 by CuriousG102 (2014-03-13 18:36:54+00:00)
Title: Contest Winners

This is a first (hastily written) version of a contest winners feature for the website. The idea is that the contest winners page will display the winners in various categories for the previous week (defined as date range of previous Monday at 11:59:59 to most recent Monday at 11:59:59).

I have a very limited knowledge of databases and front ends so I would NOT recommend approving this pull request without first reviewing the code added to dashboard/views.py

Specifically, without a large database to test this code on, I am not sure whether or not "aggregate" returns 0 for riders that have no rides, or a value like None. If it does not return 0, anomalous behavior will result.

Another assertion: There are teammates in the database.

To Do:
- Clean up the code in views.py. It's overly verbose and can easily be cut down on.
- Add support for teammate profile pics. Build these profile pics into the contest winners page
- Put the associated stats up on the contest winners page