예제 #1
0
 def put(self, persona_name):
   session_id = get_session_id(session, request)
   dao = PersonaDAO(session_id)
   persona_prop = dao.from_json(request, to_props=True)
   dao.update_persona_properties(persona_prop, name=persona_name)
   dao.close()
   resp_dict = {'message': 'The persona properties were successfully updated.'}
   resp = make_response(json_serialize(resp_dict), httplib.OK)
   resp.contenttype = 'application/json'
   return resp
예제 #2
0
 def put(self, persona_name):
   session_id = get_session_id(session, request)
   dao = PersonaDAO(session_id)
   persona_prop = dao.from_json(request, to_props=True)
   dao.update_persona_properties(persona_prop, name=persona_name)
   dao.close()
   resp_dict = {'message': 'The persona properties were successfully updated.'}
   resp = make_response(json_serialize(resp_dict), OK)
   resp.contenttype = 'application/json'
   return resp
예제 #3
0
  def put(self, name):
    session_id = get_session_id(session, request)

    dao = PersonaDAO(session_id)
    req = dao.from_json(request)
    dao.update_persona(req, name=name)
    dao.close()

    resp_dict = {'message': 'Persona successfully updated'}
    resp = make_response(json_serialize(resp_dict), httplib.OK)
    resp.headers['Content-type'] = 'application/json'
    return resp
예제 #4
0
  def post(self):
    session_id = get_session_id(session, request)

    dao = PersonaDAO(session_id)
    new_persona = dao.from_json(request)
    persona_id = dao.add_persona(new_persona)
    dao.close()

    resp_dict = {'message': 'Persona successfully added', 'persona_id': persona_id}
    resp = make_response(json_serialize(resp_dict), httplib.OK)
    resp.contenttype = 'application/json'
    return resp
예제 #5
0
    def put(self, name):
        session_id = get_session_id(session, request)

        dao = PersonaDAO(session_id)
        req = dao.from_json(request)
        dao.update_persona(req, name=name)
        dao.close()

        resp_dict = {'message': 'Persona successfully updated'}
        resp = make_response(json_serialize(resp_dict), httplib.OK)
        resp.headers['Content-type'] = 'application/json'
        return resp
예제 #6
0
    def post(self):
        session_id = get_session_id(session, request)

        dao = PersonaDAO(session_id)
        new_persona = dao.from_json(request)
        dao.add_persona(new_persona)
        dao.close()

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