def put(self, name): session_id = get_session_id(session, request) dao = PersonaCharacteristicDAO(session_id) upd_pc = dao.from_json(request) dao.update_persona_characteristic(upd_pc, name) dao.close() resp_dict = {'message': 'Persona Characteristic successfully updated'} resp = make_response(json_serialize(resp_dict), httplib.OK) resp.contenttype = 'application/json' return resp
def post(self): session_id = get_session_id(session, request) dao = PersonaCharacteristicDAO(session_id) new_pc = dao.from_json(request) dao.add_persona_characteristic(new_pc) dao.close() resp_dict = {"message": "Persona Characteristic successfully added"} resp = make_response(json_serialize(resp_dict, session_id=session_id), httplib.OK) resp.contenttype = "application/json" return resp
def put(self, name): session_id = get_session_id(session, request) dao = PersonaCharacteristicDAO(session_id) upd_pc = dao.from_json(request) dao.update_persona_characteristic(upd_pc, name) dao.close() resp_dict = {"message": "Persona Characteristic successfully updated"} resp = make_response(json_serialize(resp_dict), httplib.OK) resp.contenttype = "application/json" return resp
def post(self): session_id = get_session_id(session, request) dao = PersonaCharacteristicDAO(session_id) new_pc = dao.from_json(request) dao.add_persona_characteristic(new_pc) dao.close() resp_dict = {'message': 'Persona Characteristic successfully added'} resp = make_response(json_serialize(resp_dict, session_id=session_id), httplib.OK) resp.contenttype = 'application/json' return resp
def post(self): session_id = get_session_id(session, request) dao = PersonaCharacteristicDAO(session_id) new_pc,ps,rss,rcs = dao.from_json(request) dao.add_persona_characteristic(new_pc) if (ps != None): dao.assignIntentionalElements(ps,rss,rcs) dao.close() resp_dict = {'message': 'Persona Characteristic successfully added'} resp = make_response(json_serialize(resp_dict, session_id=session_id), OK) resp.contenttype = 'application/json' return resp
def put(self, name): session_id = get_session_id(session, request) dao = PersonaCharacteristicDAO(session_id) upd_pc, ps, rss, rcs = dao.from_json(request) dao.update_persona_characteristic(upd_pc, name) if (ps != None): dao.assignIntentionalElements(ps, rss, rcs) dao.close() resp_dict = {'message': 'Persona Characteristic successfully updated'} resp = make_response(json_serialize(resp_dict), OK) resp.contenttype = 'application/json' return resp
def post(self): session_id = get_session_id(session, request) dao = PersonaCharacteristicDAO(session_id) new_pc, ps, rss, rcs = dao.from_json(request) dao.add_persona_characteristic(new_pc) if (ps != None): dao.assignIntentionalElements(ps, rss, rcs) dao.close() resp_dict = {'message': new_pc.characteristic() + ' created'} resp = make_response(json_serialize(resp_dict, session_id=session_id), OK) resp.contenttype = 'application/json' return resp