Example #1
0
 def find_nearest_city(self):
     if PlaceBoundary:
         cached = self.get_cached('nearest_city')
         if cached:
             return cached
         try:
             result = PlaceBoundary.get_nearest_to(self.location)
             self.set_cached('nearest_city', result)
             return result
         except PlaceBoundary.DoesNotExist:
             pass
     return None
Example #2
0
 def city(self):
     if PlaceBoundary:
         cached = self.get_cached('city')
         if cached:
             return cached
         try:
             result = PlaceBoundary.get_containing(self.location)
             self.set_cached('city', result)
             return result
         except PlaceBoundary.DoesNotExist:
             pass
     return None