From 81bb3ad57de2e683e8cf0a43af629b77d5b74deb Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Fri, 21 Dec 2012 17:38:53 -0500 Subject: [PATCH] Fix the player JSON view with a _asdict() method to RecentGame-s. --- xonstat/views/helpers.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/xonstat/views/helpers.py b/xonstat/views/helpers.py index 1ae8350..1affe0d 100644 --- a/xonstat/views/helpers.py +++ b/xonstat/views/helpers.py @@ -48,6 +48,26 @@ class RecentGame(object): except: self.elo_delta = None + def _asdict(self): + return { + "game_id": self.game_id, + "game_type_cd": self.game_type_cd, + "winner": self.winner, + "start_dt": self.start_dt, + "fuzzy_dt": self.fuzzy_date, + "epoch": self.epoch, + "server_id": self.server_id, + "server_name": self.server_name, + "map_id": self.map_id, + "map_name": self.map_name, + "player_id": self.player_id, + "nick": self.nick, + "nick_html_colors": self.nick_html_colors, + "rank": self.rank, + "team": self.team, + "elo_delta": self.elo_delta, + } + def recent_games_q(server_id=None, map_id=None, player_id=None, cutoff=None): ''' -- 2.39.2