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.
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: