From: Ant Zucaro Date: Tue, 3 Oct 2017 00:07:44 +0000 (-0400) Subject: Add mappings for the player_game_frag_matrix table. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2416f28b89e994760fef7c1f70191d1a814ec9d5;p=xonotic%2Fxonstat.git Add mappings for the player_game_frag_matrix table. --- diff --git a/xonstat/models/__init__.py b/xonstat/models/__init__.py index 884ba05..39bc8ed 100644 --- a/xonstat/models/__init__.py +++ b/xonstat/models/__init__.py @@ -58,6 +58,7 @@ def initialize_db(engine=None): active_servers_table = metadata.tables['active_servers_mv'] active_maps_table = metadata.tables['active_maps_mv'] player_medals_table = metadata.tables['player_medals'] + player_game_frag_matrix_table = metadata.tables['player_game_frag_matrix'] # Map the tables and the objects together mapper(PlayerAchievement, achievements_table) @@ -83,3 +84,4 @@ def initialize_db(engine=None): mapper(ActiveServer, active_servers_table) mapper(ActiveMap, active_maps_table) mapper(PlayerMedal, player_medals_table) + mapper(PlayerGameFragMatrix, player_game_frag_matrix_table) diff --git a/xonstat/models/game.py b/xonstat/models/game.py index 18cf9e8..e9cf29c 100644 --- a/xonstat/models/game.py +++ b/xonstat/models/game.py @@ -191,4 +191,17 @@ class Weapon(object): 'weapon_cd': self.weapon_cd, 'name': self.descr, 'active': self.active_ind, - } \ No newline at end of file + } + + +class PlayerGameFragMatrix(object): + """ + Frags made by an individual player in a single game. + """ + + def __init__(self, game_id, player_game_stat_id): + self.game_id = game_id + self.player_game_stat_id = player_game_stat_id + + def __repr__(self): + return "".format(self)