예제 #1
0
파일: resources.py 프로젝트: DavidTatis/bd
 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
예제 #2
0
파일: resources.py 프로젝트: DavidTatis/bd
 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
예제 #3
0
 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
예제 #4
0
파일: requests.py 프로젝트: DavidTatis/bd
 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
예제 #5
0
파일: requests.py 프로젝트: DavidTatis/bd
 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
예제 #6
0
 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
예제 #7
0
파일: resources.py 프로젝트: DavidTatis/bd
 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