コード例 #1
0
ファイル: GoalController.py プロジェクト: failys/cairis
 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
ファイル: GoalController.py プロジェクト: we45/cairis
 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
ファイル: GoalController.py プロジェクト: failys/cairis
  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