From 8a0cfb47ee3f03476ba0301ebcfe7b41a1e67e08 Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Sun, 1 Sep 2013 17:40:18 -0400 Subject: [PATCH] Pull various things from params. --- xonstat/views/player.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/xonstat/views/player.py b/xonstat/views/player.py index 421eb7a..ce43fdf 100644 --- a/xonstat/views/player.py +++ b/xonstat/views/player.py @@ -1036,12 +1036,29 @@ def player_captimes(request): def player_captimes_json(request): return player_captimes_data(request) + def player_nvd3_damage(request): player_id = int(request.matchdict['id']) if player_id <= 2: player_id = -1; - return {} + game_type_cd = None + if request.params.has_key("game_type"): + game_type_cd = request.params["game_type"] + + limit = 20 + if request.params.has_key("limit"): + limit = int(request.params["limit"]) + + if limit < 0: + limit = 20 + if limit > 50: + limit = 50 + + return { "player_id": player_id, + "game_type_cd": game_type_cd, + "limit": limit, + } def player_damage_data_v2(request): player_id = request.matchdict["id"] -- 2.39.2