def put(self, name): session_id = get_session_id(session, request) dao = TemplateAssetDAO(session_id) upd_ta = dao.from_json(request) dao.update_template_asset(upd_ta, name) dao.close() resp_dict = {'message': 'Template Asset 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 = TemplateAssetDAO(session_id) new_ta = dao.from_json(request) dao.add_template_asset(new_ta) dao.close() resp_dict = {'message': 'Template Asset successfully added'} resp = make_response(json_serialize(resp_dict, session_id=session_id), OK) resp.contenttype = 'application/json' return resp