예제 #1
0
 def get(self):
   session_id = get_session_id(session, request)
   environment_name = request.args.get('environment_name', '')
   dao = GoalAssociationDAO(session_id)
   assocs = dao.get_goal_associations(environment_name)
   dao.close()
   resp = make_response(json_serialize(assocs, session_id=session_id))
   resp.headers['Content-Type'] = "application/json"
   return resp
예제 #2
0
 def get(self):
     session_id = get_session_id(session, request)
     environment_name = request.args.get('environment_name', '')
     dao = GoalAssociationDAO(session_id)
     assocs = dao.get_goal_associations(environment_name)
     dao.close()
     resp = make_response(json_serialize(assocs, session_id=session_id))
     resp.headers['Content-Type'] = "application/json"
     return resp
예제 #3
0
  def delete(self,environment_name,goal_name,subgoal_name):
    session_id = get_session_id(session, request)
    dao = GoalAssociationDAO(session_id)
    dao.delete_goal_association(environment_name,goal_name,subgoal_name)
    dao.close()

    resp_dict = {'message': 'Goal Association successfully deleted'}
    resp = make_response(json_serialize(resp_dict), httplib.OK)
    resp.contenttype = 'application/json'
    return resp
예제 #4
0
  def get(self,environment_name,goal_name,subgoal_name):
    session_id = get_session_id(session, request)

    dao = GoalAssociationDAO(session_id)
    assoc = dao.get_goal_association(environment_name,goal_name,subgoal_name)
    dao.close()

    resp = make_response(json_serialize(assoc, session_id=session_id))
    resp.headers['Content-Type'] = "application/json"
    return resp
예제 #5
0
    def get(self, environment_name, goal_name, subgoal_name):
        session_id = get_session_id(session, request)

        dao = GoalAssociationDAO(session_id)
        assoc = dao.get_goal_association(environment_name, goal_name,
                                         subgoal_name)
        dao.close()

        resp = make_response(json_serialize(assoc, session_id=session_id))
        resp.headers['Content-Type'] = "application/json"
        return resp
예제 #6
0
    def put(self):
        session_id = get_session_id(session, request)
        dao = GoalAssociationDAO(session_id)
        assoc = dao.from_json(request)
        dao.update_goal_association(assoc)
        dao.close()

        resp_dict = {'message': 'Goal Association successfully updated'}
        resp = make_response(json_serialize(resp_dict), OK)
        resp.contenttype = 'application/json'
        return resp
예제 #7
0
    def delete(self, environment_name, goal_name, subgoal_name):
        session_id = get_session_id(session, request)
        dao = GoalAssociationDAO(session_id)
        dao.delete_goal_association(environment_name, goal_name, subgoal_name)
        dao.close()

        resp_dict = {'message': 'Goal Association successfully deleted'}
        resp = make_response(json_serialize(resp_dict), httplib.OK)
        resp.contenttype = 'application/json'
        return resp
예제 #8
0
  def put(self):
    session_id = get_session_id(session, request)
    dao = GoalAssociationDAO(session_id)
    assoc = dao.from_json(request)
    dao.update_goal_association(assoc)
    dao.close()

    resp_dict = {'message': 'Goal Association successfully updated'}
    resp = make_response(json_serialize(resp_dict), httplib.OK)
    resp.contenttype = 'application/json'
    return resp
예제 #9
0
  def put(self,environment_name,goal_name,subgoal_name):
    session_id = get_session_id(session, request)
    dao = GoalAssociationDAO(session_id)
    assoc = dao.from_json(request)
    dao.update_goal_association(assoc,unquote(environment_name),unquote(goal_name),unquote(subgoal_name))
    dao.close()

    resp_dict = {'message': 'Goal Association successfully updated'}
    resp = make_response(json_serialize(resp_dict), OK)
    resp.contenttype = 'application/json'
    return resp