]> git.rm.cloudns.org Git - xonotic/xonstat.git/commitdiff
Wire up the Glicko tables in the ORM.
authorAnt Zucaro <azucaro@gmail.com>
Tue, 19 Dec 2017 19:44:37 +0000 (14:44 -0500)
committerAnt Zucaro <azucaro@gmail.com>
Tue, 19 Dec 2017 19:44:37 +0000 (14:44 -0500)
xonstat/models/__init__.py
xonstat/models/player.py

index 39bc8ed92ee3e1b3993ecf63a7005c1437ba6684..817cc372502767d542e099cc1268c7d9abe2a27b 100644 (file)
@@ -59,6 +59,8 @@ def initialize_db(engine=None):
     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']
+    player_glickos_base_table = metadata.tables['player_glickos_base']
+    player_glickos_current_table = metadata.tables['player_glickos_current']
 
     # Map the tables and the objects together
     mapper(PlayerAchievement, achievements_table)
@@ -85,3 +87,5 @@ def initialize_db(engine=None):
     mapper(ActiveMap, active_maps_table)
     mapper(PlayerMedal, player_medals_table)
     mapper(PlayerGameFragMatrix, player_game_frag_matrix_table)
+    mapper(PlayerGlicko, player_glickos_current_table)
+    mapper(PlayerGlickoBase, player_glickos_base_table)
index 655aa5ce9956526e59025b89c98e83994c82ba43..fece334272b71ee51a97fb7fe27ebe43662c4981 100644 (file)
@@ -255,4 +255,12 @@ class PlayerGlicko(object):
             mu=self.mu * GLICKO2_SCALE + MU,
             phi=self.phi * GLICKO2_SCALE,
             sigma=self.sigma
-        )
\ No newline at end of file
+        )
+
+
+class PlayerGlickoBase(PlayerGlicko):
+    """
+    A clone of the above PlayerGlicko class, but created separately in order to avoid
+    dealing with primary and non-primary SQLAlchemy mappers.
+    """
+    pass
\ No newline at end of file