]> de.git.xonotic.org Git - xonotic/xonstat.git/blobdiff - xonstat/views/player.py
Add more info to the player_info view and template
[xonotic/xonstat.git] / xonstat / views / player.py
index 4dbed66f8a1dccc58ba98e1ec3d3d031e98bc443..8f8b4d6eb67c28ac8e656e742cf180e3dfb9a136 100755 (executable)
@@ -57,13 +57,15 @@ def player_info(request):
                 game_stats['total_destroys'], game_stats['total_dhk'], \r
                 game_stats['total_pushes'], game_stats['total_pushed'], \r
                 game_stats['total_carrier_frags'], \r
-                game_stats['total_alivetime']) = DBSession.\\r
+                game_stats['total_alivetime'],\r
+                game_stats['total_games_played']) = DBSession.\\r
                         query("avg_rank", "total_kills", "total_deaths", \r
                 "total_suicides", "total_score", "total_time", "total_held",\r
                 "total_captures", "total_pickups", "total_drops", \r
                 "total_returns", "total_collects", "total_destroys", \r
                 "total_dhk", "total_pushes", "total_pushed", \r
-                "total_carrier_frags", "total_alivetime").\\r
+                "total_carrier_frags", "total_alivetime", \r
+                "total_games_played").\\r
                 from_statement(\r
                     "select round(avg(rank)) avg_rank, sum(kills) total_kills, "\r
                     "sum(deaths) total_deaths, sum(suicides) total_suicides, "\r
@@ -74,7 +76,7 @@ def player_info(request):
                     "sum(destroys) total_destroys, sum(destroys_holding_key) total_dhk, "\r
                     "sum(pushes) total_pushes, sum(pushed) total_pushed, "\r
                     "sum(carrier_frags) total_carrier_frags, "\r
-                    "sum(alivetime) total_alivetime "\r
+                    "sum(alivetime) total_alivetime, count(*) total_games_played "\r
                     "from player_game_stats "\r
                     "where player_id=:player_id"\r
                 ).params(player_id=player_id).one()\r