Exemplo n.º 1
0
 def post(self):
   session_id = get_session_id(session, request)
   dao = RoleDAO(session_id)
   new_role = dao.from_json(request)
   dao.add_role(new_role)
   dao.close()
   resp_dict = {'message': 'Add successful'}
   resp = make_response(json_serialize(resp_dict, session_id=session_id), OK)
   resp.contenttype = 'application/json'
   return resp
Exemplo n.º 2
0
 def post(self):
     session_id = get_session_id(session, request)
     dao = RoleDAO(session_id)
     new_role = dao.from_json(request)
     dao.add_role(new_role)
     dao.close()
     resp_dict = {'message': 'Add successful'}
     resp = make_response(json_serialize(resp_dict, session_id=session_id),
                          OK)
     resp.contenttype = 'application/json'
     return resp
Exemplo n.º 3
0
    def post(self):
        session_id = get_session_id(session, request)

        dao = RoleDAO(session_id)
        new_role = dao.from_json(request)
        role_id = dao.add_role(new_role)
        dao.close()

        resp_dict = {'role_id': role_id}
        resp = make_response(json_serialize(resp_dict, session_id=session_id), httplib.OK)
        resp.contenttype = 'application/json'
        return resp
Exemplo n.º 4
0
    def post(self):
        session_id = get_session_id(session, request)

        dao = RoleDAO(session_id)
        new_role = dao.from_json(request)
        role_id = dao.add_role(new_role)
        dao.close()

        resp_dict = {'role_id': role_id}
        resp = make_response(json_serialize(resp_dict, session_id=session_id),
                             httplib.OK)
        resp.contenttype = 'application/json'
        return resp