def locations(self): locations = [] for location_id in self.location_ids: location = cache.get(LOCATION_CACHE_KEY % location_id, False) if not location: location = Location.get_location_or_unknown(id=location_id) cache.set(LOCATION_CACHE_KEY % location_id, location, LOCATION_CACHE_TIME) locations.append(location) return locations
def location(self): if self.location_id is not None: return Location.get_location_or_unknown(id=self.location_id)
def location(self): return Location.get_location_or_unknown(self.location_id)
def location(self): """The location of the reporting node""" return Location.get_location_or_unknown(self.location_id)
def location(self): if not self.location_id: return None else: return Location.get_location_or_unknown(id=self.location_id)