]> git.rm.cloudns.org Git - xonotic/xonstat.git/commitdiff
Remove the server_game_index view.
authorAnt Zucaro <azucaro@gmail.com>
Wed, 18 Mar 2015 10:43:02 +0000 (06:43 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Wed, 18 Mar 2015 10:43:02 +0000 (06:43 -0400)
This view was replaced by the game_finder view. During that time I removed the
other views that implemented this functionality, but I must have missed this
one! It still had an active route mapping, although no other route used it.

xonstat/__init__.py
xonstat/views/server.py

index 0dfe363c72bea32d7b4a097dacc4df2292e5c426..55cce5b4707f1a84d085e1a370c04e58dee64b99 100644 (file)
@@ -133,12 +133,6 @@ def main(global_config, **settings):
     config.add_route("server_index_json", "/servers.json")
     config.add_view(server_index_json, route_name="server_index_json", renderer="jsonp")
 
-    config.add_route("server_game_index",      "/server/{server_id:\d+}/games/page/{page:\d+}")
-    config.add_view(server_game_index,      route_name="server_game_index",      renderer="server_game_index.mako")
-
-    config.add_route("server_game_index_json", "/server/{server_id:\d+}/games.json")
-    config.add_view(server_game_index_json, route_name="server_game_index_json", renderer="jsonp")
-
     config.add_route("server_info",      "/server/{id:\d+}")
     config.add_view(server_info,      route_name="server_info",      renderer="server_info.mako")
 
index e685f96e46096c4723ac7e3ed33becb67ff775ec..6270ed0338585e3ea346d2940aa076f81cb532b1 100644 (file)
@@ -144,40 +144,3 @@ def server_info_json(request):
     List the stored information about a given server. JSON.
     """
     return [{'status':'not implemented'}]
-
-
-def _server_game_index_data(request):
-    server_id = request.matchdict['server_id']
-    current_page = request.matchdict['page']
-
-    try:
-        server = DBSession.query(Server).filter_by(server_id=server_id).one()
-
-        games_q = DBSession.query(Game, Server, Map).\
-                filter(Game.server_id == server_id).\
-                filter(Game.server_id == Server.server_id).\
-                filter(Game.map_id == Map.map_id).\
-                order_by(Game.game_id.desc())
-
-        games = Page(games_q, current_page, url=page_url)
-    except Exception as e:
-        server = None
-        games = None
-        raise e
-
-    return {'games':games,
-            'server':server}
-
-
-def server_game_index(request):
-    """
-    List the games played on a given server. Paginated.
-    """
-    return _server_game_index_data(request)
-
-
-def server_game_index_json(request):
-    """
-    List the games played on a given server. Paginated. JSON.
-    """
-    return [{'status':'not implemented'}]