config.add_route("player_hashkey_info_json", "/player/{hashkey:.{44}}.json")
config.add_view(player_hashkey_info_json, route_name="player_hashkey_info_json", renderer="jsonp")
- #config.add_route("player_hashkey_info_text", "/player/me")
- config.add_route("player_hashkey_info_text", "/player/{hashkey}")
+ config.add_route("player_hashkey_info_text", "/player/me")
config.add_view(player_hashkey_info_text, route_name="player_hashkey_info_text", renderer="player_hashkey_info_text.mako")
config.add_route("player_info_json", "/player/{id:\d+}.json")
def player_hashkey_info_data(request):
- #(idfp, status) = verify_request(request)
- #print "player_hashkey_info_data [idfp={0} status={1}]".format(idfp, status)
-
- hashkey = request.matchdict['hashkey']
+ (idfp, status) = verify_request(request)
# if config is to *not* verify requests and we get nothing back, this
# query will return nothing and we'll 404.
player = DBSession.query(Player).\
filter(Player.player_id == Hashkey.player_id).\
filter(Player.active_ind == True).\
- filter(Hashkey.hashkey == hashkey).one()
+ filter(Hashkey.hashkey == idfp).one()
games_played = get_games_played(player.player_id)
overall_stats = get_overall_stats(player.player_id)