From: Ant Zucaro Date: Sat, 29 Apr 2017 14:46:59 +0000 (-0400) Subject: Add a 'category' attribute to PlayerElo. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6a1b1eada7e1975344532b5a227e8c3e8d26485c;p=xonotic%2Fxonstat.git Add a 'category' attribute to PlayerElo. --- diff --git a/xonstat/models/player.py b/xonstat/models/player.py index d9df075..2fcf58f 100644 --- a/xonstat/models/player.py +++ b/xonstat/models/player.py @@ -103,21 +103,23 @@ class PlayerElo(object): A player's skill for a particular game type, as determined by a modified Elo algorithm. """ - def __init__(self, player_id=None, game_type_cd=None, elo=None): + def __init__(self, player_id=None, game_type_cd=None, elo=None, category="general"): self.player_id = player_id self.game_type_cd = game_type_cd self.elo = elo self.score = 0 self.games = 0 + self.category = category def __repr__(self): - return ("".format(self)) + return ("".format(self)) def to_dict(self): return { 'player_id': self.player_id, 'game_type_cd': self.game_type_cd, + 'category': self.category, 'elo': self.elo, 'games': self.games, }