Skip to content

Instantly share code, notes, and snippets.

@rosskarchner
Created August 12, 2014 21:27
Show Gist options
  • Save rosskarchner/3483112edda709f43da6 to your computer and use it in GitHub Desktop.
Save rosskarchner/3483112edda709f43da6 to your computer and use it in GitHub Desktop.
if 'result' in result:
cg, created = CachedGeodata.objects.get_or_create(key=key)
cg.lat=result['result'][1]
cg.lon=result['result'][2]
cg.expires = int(time.time()) + getattr(settings, 'DJANGO_HUD_GEODATA_EXPIRATION_INTERVAL', 1728000)
cg.save()
data = result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment