From 6a1b1eada7e1975344532b5a227e8c3e8d26485c Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Sat, 29 Apr 2017 10:46:59 -0400 Subject: [PATCH] Add a 'category' attribute to PlayerElo. --- xonstat/models/player.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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, } -- 2.39.2