示例#1
0
 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
示例#2
0
 def location(self):
     if self.location_id is not None:
         return Location.get_location_or_unknown(id=self.location_id)
示例#3
0
 def location(self):
     return Location.get_location_or_unknown(self.location_id)
示例#4
0
 def location(self):
     """The location of the reporting node"""
     return Location.get_location_or_unknown(self.location_id)
示例#5
0
 def location(self):
     if not self.location_id:
         return None
     else:
         return Location.get_location_or_unknown(id=self.location_id)