def getResourceAvailableByName(self, rname): dao = ResourcesDAO() requests = dao.getResourceAvailableByName(rname) dic = Dictionary() result_list = [] for row in requests: result = dic.build_resource_dict(row) result_list.append(result) return jsonify(Requests=result_list), 200
def getResourceRequestedByRequestID(self, rid, ord_id): dao = ResourcesDAO() requests = dao.getResourceRequestedByRequestID(rid, ord_id) dic = Dictionary() result_list = [] for row in requests: result = dic.build_resource_dict(row) result_list.append(result) return jsonify(Requests=result_list), 200
def getAllUsers(self): dao = UsersDAO() users = dao.getAllUsers() dic=Dictionary() result_list=[] for row in users: result=dic.build_user_dict(row) result_list.append(result) return jsonify(Users=result_list), 200
def getAllRequests(self): dao = RequestsDAO() requests = dao.getAllRequests() dic = Dictionary() result_list = [] for row in requests: result = dic.build_request_dict(row) result_list.append(result) return jsonify(Requests=result_list), 200
def getReservesByID(self, req_id): dao = RequestsDAO() requests = dao.getReservesByID(req_id) dic = Dictionary() result_list = [] for row in requests: result = dic.build_reserves_dict(row) result_list.append(result) return jsonify(Requests=result_list), 200
def getAllOrganizations(self): dao = OrganizationsDAO() dic = Dictionary() organizations_list = dao.getAllOrganizations() organizations = [] for row in organizations_list: result = dic.build_organization_dict(row) organizations.append(result) return jsonify(Organizations=organizations), 200
def getResourceById(self, resource_id): dao = ResourcesDAO() requests = dao.getResourceByID(resource_id) dic = Dictionary() result = dic.build_resource_dict(requests) return jsonify(Requests=result), 200