@view_config(route_name='get_achievement_level', renderer='string', request_method="GET")
def get_achievement_level(request): 
    try:
        achievement_id = int(request.matchdict.get("achievement_id",None))
        level = int(request.matchdict.get("level",None))
    except:
        raise BadRequest("invalid input")
         
    def generate():
        achievement = Achievement.get_achievement(achievement_id)
         
        if not achievement:
            raise NotFound("achievement not found")
         
        level_output = Achievement.basic_output(achievement, [], True, level).get("levels").get(str(level), {"properties":{},"rewards":{}})
        if level_output.has_key("goals"):
            del level_output["goals"]
        if level_output.has_key("level"):
            del level_output["level"]
        return render("json",level_output)
     
    key = "/achievement/"+str(achievement_id)+"/level/"+str(level)
    request.response.content_type = 'application/json'
         
    return get_or_set(key,generate)
get all information about an achievement for a specific level
dataset/ETHPy150Open ActiDoo/gamification-engine/gengine/views.py/get_achievement_level