]> git.rm.cloudns.org Git - xonotic/xonstat.git/commitdiff
Fix the top maps count.
authorAnt Zucaro <azucaro@gmail.com>
Sun, 16 Oct 2011 23:18:47 +0000 (19:18 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Sun, 16 Oct 2011 23:18:47 +0000 (19:18 -0400)
xonstat/views/main.py

index c22fc88ce06fb6d5451e639ddf84f4c1c28b6c78..e848410fc5a6274875db5b901733b4cd90f40243 100755 (executable)
@@ -38,13 +38,15 @@ def main_index(request):
         top_servers.append(('-', '-', '-'))
 
     # top maps by total times played
-    top_maps = DBSession.query(Map.map_id, Map.name, 
-            func.count(Game.game_id)).\
-            filter(Map.map_id==Game.game_id).\
-            order_by(expr.desc(func.count(Game.game_id))).\
-            group_by(Map.map_id).\
+    top_maps = DBSession.query(Game.map_id, Map.name, 
+            func.count()).\
+            filter(Map.map_id==Game.map_id).\
+            order_by(expr.desc(func.count())).\
+            group_by(Game.map_id).\
             group_by(Map.name).all()[0:10]
 
+    log.debug(top_maps)
+
     for i in range(leaderboard_count-len(top_maps)):
         top_maps.append(('-', '-', '-'))