]> git.xonotic.org Git - xonotic/xonstat.git/blobdiff - xonstat/models.py
Add initial support for JSON on map_index view.
[xonotic/xonstat.git] / xonstat / models.py
index d53e1daeb4fa4cf3bd187d4ec105b6021c02a335..d5cd88540db2b4b154626752620268daf6c16776 100755 (executable)
@@ -1,3 +1,4 @@
+import json
 import logging
 import math
 import sqlalchemy
@@ -66,6 +67,9 @@ class Map(object):
     def __repr__(self):
         return "<Map(%s, %s, %s)>" % (self.map_id, self.name, self.version)
 
+    def to_dict(self):
+        return {'map_id':self.map_id, 'name':self.name}
+
 
 class Game(object):
     def __init__(self, game_id=None, start_dt=None, game_type_cd=None,