def neighborhood(self): if Neighborhood: cached = self.get_cached('neighborhood') if cached: return cached try: result = Neighborhood.get_containing(self.location) self.set_cached('neighborhood', result) return result except Neighborhood.DoesNotExist: pass return None
def get_neighborhood(self, row, geometry): place = Neighborhood() place.source, created = NeighborhoodSource.objects.get_or_create( name='City of Portland, Oregon', slug='city-of-portland-oregon', priority=5 ) place.state = 'OR' place.city = 'Portland' place.name = title(row.get('NAME')) place.region_id = row.get('NBO_ID') place.geog = geometry.wkt return place
def get_neighborhood(self, row, geometry): place = Neighborhood() place.source, created = NeighborhoodSource.objects.get_or_create( name='Zillow', slug='zillow', priority=10 ) place.state = row.get('STATE') place.city = row.get('CITY') place.name = row.get('NAME') place.region_id = row.get('REGIONID') place.geog = geometry.wkt return place