]> git.xonotic.org Git - xonotic/xonstat.git/commit
Make the "recent games" section more modular.
authorAnt Zucaro <azucaro@gmail.com>
Mon, 19 Nov 2012 00:27:14 +0000 (19:27 -0500)
committerJan Behrens <zykure@web.de>
Sun, 23 Dec 2012 14:18:34 +0000 (15:18 +0100)
commit90499e2a01eebca95b55b22ed12accc112635c48
tree1a5fcf4f384d00890244c57e4c37da2f143db1c6
parent352efced080401c7836ec151a87f592465d249f8
Make the "recent games" section more modular.

The main page was constructing all of the recent games queries
manually before. Now I've moved the query and the associated
class (which would have been a namedtuple if not for the various
transformations needed) into a new "helpers" view. This view is
intended to house query functions and the corresponding classes
for them, so no more grabbing from a query, then looping around
and creating namedtuples to get stuff like nick_html_colors. Now
one can just pass the row returned by the query to a class, which
will "know" how to construct stuff like that. Win!
xonstat/templates/main_index.mako
xonstat/views/helpers.py [new file with mode: 0644]
xonstat/views/main.py