def get_relevant_supply_point_ids(domain, active_location=None): if active_location: return supply_point_ids([active_location] + active_location.descendants) else: return supply_point_ids(all_locations(domain))
def _descendants(self, loc_type=None): locs = self.active_location.descendants if self.active_location else all_locations( self.domain) return filter( lambda loc: loc_type is None or loc.location_type == loc_type, locs)
def _descendants(self, loc_type=None): locs = self.active_location.descendants if self.active_location else all_locations(self.domain) return filter(lambda loc: loc_type is None or loc.location_type == loc_type, locs)