Ejemplo n.º 1
0
    def get(self, name):
        session_id = get_session_id(session, request)

        dao = TemplateRequirementDAO(session_id)
        found_tr = dao.get_template_requirement(name)
        dao.close()

        resp = make_response(json_serialize(found_tr, session_id=session_id))
        resp.headers['Content-Type'] = "application/json"
        return resp
Ejemplo n.º 2
0
  def get(self, name):
    session_id = get_session_id(session, request)

    dao = TemplateRequirementDAO(session_id)
    found_tr = dao.get_template_requirement(name)
    dao.close()

    resp = make_response(json_serialize(found_tr, session_id=session_id))
    resp.headers['Content-Type'] = "application/json"
    return resp
Ejemplo n.º 3
0
  def get(self):
    session_id = get_session_id(session, request)
    constraint_id = request.args.get('constraint_id', -1)

    dao = TemplateRequirementDAO(session_id)
    trs = dao.get_template_requirements(constraint_id=constraint_id)
    dao.close()

    resp = make_response(json_serialize(trs, session_id=session_id))
    resp.headers['Content-Type'] = "application/json"
    return resp
Ejemplo n.º 4
0
  def delete(self, name):
    session_id = get_session_id(session, request)

    dao = TemplateRequirementDAO(session_id)
    dao.delete_template_requirement(name)
    dao.close()

    resp_dict = {'message': 'Template Requirement successfully deleted'}
    resp = make_response(json_serialize(resp_dict), httplib.OK)
    resp.contenttype = 'application/json'
    return resp
Ejemplo n.º 5
0
    def get(self):
        session_id = get_session_id(session, request)
        constraint_id = request.args.get('constraint_id', -1)

        dao = TemplateRequirementDAO(session_id)
        trs = dao.get_template_requirements(constraint_id=constraint_id)
        dao.close()

        resp = make_response(json_serialize(trs, session_id=session_id))
        resp.headers['Content-Type'] = "application/json"
        return resp
Ejemplo n.º 6
0
    def put(self, name):
        session_id = get_session_id(session, request)

        dao = TemplateRequirementDAO(session_id)
        upd_tr = dao.from_json(request)
        dao.update_template_requirement(upd_tr, name)
        dao.close()

        resp_dict = {'message': 'Template Requirement successfully updated'}
        resp = make_response(json_serialize(resp_dict), OK)
        resp.contenttype = 'application/json'
        return resp
Ejemplo n.º 7
0
    def post(self):
        session_id = get_session_id(session, request)

        dao = TemplateRequirementDAO(session_id)
        new_tr = dao.from_json(request)
        dao.add_template_requirement(new_tr)
        dao.close()

        resp_dict = {'message': 'Template Requirement successfully added'}
        resp = make_response(json_serialize(resp_dict, session_id=session_id),
                             OK)
        resp.contenttype = 'application/json'
        return resp
Ejemplo n.º 8
0
    def delete(self, name):
        session_id = get_session_id(session, request)

        dao = TemplateRequirementDAO(session_id)
        dao.delete_template_requirement(name)
        dao.close()

        resp_dict = {'message': 'Template Requirement successfully deleted'}
        resp = make_response(json_serialize(resp_dict), OK)
        resp.contenttype = 'application/json'
        return resp
Ejemplo n.º 9
0
  def post(self):
    session_id = get_session_id(session, request)

    dao = TemplateRequirementDAO(session_id)
    new_tr = dao.from_json(request)
    dao.add_template_requirement(new_tr)
    dao.close()

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