]> de.git.xonotic.org Git - xonotic/xonstat.git/commitdiff
Use description value in cd_weapon when displaying weapon stats. This avoids weird...
authorAnt Zucaro <azucaro@gmail.com>
Sat, 21 May 2011 20:37:10 +0000 (16:37 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Sat, 21 May 2011 20:37:10 +0000 (16:37 -0400)
xonstat/templates/player_weapon_stats.mako
xonstat/views.py

index 1a499f1d4e16d5f3e49546ae7bfe2770bc00a68e..9812b35be672f41700844c48ca3bd41c15b808ba 100644 (file)
@@ -21,9 +21,9 @@ Accuracy Information - ${parent.title()}
         <td>Frags</td>
     </tr>
 
-% for pwstat in pwstats:
+% for (pwstat, weapon) in pwstats:
     <tr>
-        <td>${pwstat.weapon_cd}</td>
+        <td>${weapon.descr}</td>
         <td>${pwstat.fired}</td>
         <td>${pwstat.hit}</td>
         <td>${pwstat.max}</td>
index b78d97c41f9b5e424c02a1544e7a999cf0b8f14d..e5fc599fedb28e42195c4f78586e8cc558893076 100755 (executable)
@@ -82,10 +82,11 @@ def player_weapon_stats(request):
     game_id = request.matchdict['game_id']
     pgstat_id = request.matchdict['pgstat_id']
     try:
-        pwstats = DBSession.query(PlayerWeaponStat).\
+        pwstats = DBSession.query(PlayerWeaponStat, Weapon).\
+                filter(PlayerWeaponStat.weapon_cd==Weapon.weapon_cd).\
                 filter_by(game_id=game_id).\
                 filter_by(player_game_stat_id=pgstat_id).\
-                order_by(PlayerWeaponStat.weapon_cd).\
+                order_by(Weapon.descr).\
                 all()
 
     except Exception as e: