From: Ant Zucaro Date: Sat, 20 Jul 2013 11:52:32 +0000 (-0400) Subject: A more comprehensive decision tree for team game stats. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7d2fe941049ee699c1516378c8ac92c673d41784;p=xonotic%2Fxonstat.git A more comprehensive decision tree for team game stats. If the game mode is CTF, order by caps. If the game mode is CA, FT, LMS, or KA then order by rounds. Otherwise order by score. This corresponds to the default settings for team_game_stat rows in the submission handler. --- diff --git a/xonstat/views/game.py b/xonstat/views/game.py index ec5ac75..21bed83 100644 --- a/xonstat/views/game.py +++ b/xonstat/views/game.py @@ -110,11 +110,12 @@ def _game_info_data(request): filter(TeamGameStat.game_id == game_id) if game.game_type_cd == 'ctf': q = q.order_by(TeamGameStat.caps.desc()) - elif game.game_type_cd == 'ca': + elif game.game_type_cd in 'ca' 'ft' 'lms' 'ka': q = q.order_by(TeamGameStat.rounds.desc()) + else: + q = q.order_by(TeamGameStat.score.desc()) - tgstats = q.order_by(TeamGameStat.score.desc()).\ - all() + tgstats = q.all() stats_by_team = OrderedDict() for pgstat in pgstats: