def get_latlng(location_name): """Geocodes a `location_name` and caches the result For now, uses Google maps geocode API """ prekey = seo_tokenize(location_name) c = GeocodeCache(prekey=prekey) latlng = c.get() if latlng is None: latlng = get_latlng_google(location_name) if latlng is None: # an exception occurred; possibly hit Google API limit latlng = (None, None,) else: c.cache_store(latlng) return latlng
def get_latlng(location_name): """Geocodes a `location_name` and caches the result For now, uses Google maps geocode API """ prekey = seo_tokenize(location_name) c = GeocodeCache(prekey=prekey) latlng = c.get() if latlng is None: latlng = get_latlng_google(location_name) if latlng is None: # an exception occurred; possibly hit Google API limit latlng = ( None, None, ) else: c.cache_store(latlng) return latlng
def seo_title(self): title = '%s' % self.name seo_title = seo_tokenize(title, lower=True) return seo_title
def get_seo_title(self): title = '%s' % self.name seo_title = seo_tokenize(title, lower=True) return seo_title