From: Ant Zucaro Date: Wed, 18 Mar 2015 10:43:02 +0000 (-0400) Subject: Remove the server_game_index view. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9757391815e2574e0ab90ac51496c325ce6df7dc;p=xonotic%2Fxonstat.git Remove the server_game_index view. 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. --- diff --git a/xonstat/__init__.py b/xonstat/__init__.py index 0dfe363..55cce5b 100644 --- a/xonstat/__init__.py +++ b/xonstat/__init__.py @@ -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") diff --git a/xonstat/views/server.py b/xonstat/views/server.py index e685f96..6270ed0 100644 --- a/xonstat/views/server.py +++ b/xonstat/views/server.py @@ -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'}]