]> de.git.xonotic.org Git - xonotic/xonstat.git/commit
Add initial support for JSON on map_index view.
authorAnt Zucaro <azucaro@gmail.com>
Wed, 16 May 2012 02:37:38 +0000 (22:37 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Wed, 16 May 2012 02:37:38 +0000 (22:37 -0400)
commita772877fc61426eda6928c52967aa257c4ade111
treeb6119a3750d6b1126ea1ea5b3e0ece4daede2c2a
parenta854f5e3a7cdfb1c16f5611d8909c90d6856edc6
Add initial support for JSON on map_index view.

This commit adds initial JSON support to the map_index view.
I am giving each model class a to_dict function that returns
a select number of its instance variables back in the form of
a dictionary, which can then be returned directly by a JSON
renderer. I'm not sure if this is the right way to go, but
it works for now.

I've also ripped out the main "data-calling" piece of each
view callable into a separate function so that the JSON-
enabled view callable can use it. The non-JSON one just
returns the result of that function, while the JSON one
massages the data to be able to make it fit better for
API-like consumption.
xonstat/__init__.py
xonstat/models.py
xonstat/views/__init__.py
xonstat/views/map.py