def getRegionById(self, region_id): dao = RegionDAO() row = dao.getRegionById(region_id) if not row: return jsonify(Error="Region Not Found"), 404 else: region = self.build_region_dict(row) return jsonify(Region=region)
def getResourcesBySRegionId(self, region_id): dao = RegionDAO() if not dao.getRegionById(region_id): return jsonify(Error="Reggion Not Found"), 404 resources_list = dao.getResourcesByRegionId(region_id) result_list = [] for row in resources_list: result = self.build_resource_dict(row) result_list.append(result) return jsonify(Resources=result_list)