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
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
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
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
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
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
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
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