def _get_ride_requests(transaction: Transaction = None, ids: set = None) -> dict: if ids is None: return dict() else: refs = [RideRequestGenericDao().ref_from_id(rid) for rid in ids] ride_requests = { ref.id: RideRequestGenericDao.get_with_transaction(transaction, ref) for ref in refs } return ride_requests
def _get_existing_ride_requests(transaction: Transaction = None, orbit: Orbit = None) -> dict: refs = [ ticket["rideRequestRef"] for user_id, ticket in orbit.user_ticket_pairs.items() ] ride_requests = { ref.id: RideRequestGenericDao.get_with_transaction(transaction, ref) for ref in refs } return ride_requests