pattern="/game/{game_id:\d+}/stats/{pgstat_id:\d+}",
view=player_weapon_stats, renderer='player_weapon_stats.mako')
+ config.add_route(name="player_game_index_default",
+ pattern="/player/{player_id:\d+}/games",
+ view=player_game_index, renderer='player_game_index.mako')
+
config.add_route(name="player_game_index",
pattern="/player/{player_id:\d+}/games/page/{page:\d+}",
view=player_game_index, renderer='player_game_index.mako')
def player_game_index(request):
player_id = request.matchdict['player_id']
- current_page = request.matchdict['page']
+
+ if 'page' in request.matchdict:
+ current_page = request.matchdict['page']
+ else:
+ current_page = 1
try:
player = DBSession.query(Player).filter_by(player_id=player_id).one()