Save Geolocation for an Address based model on save()
This code will work on any model using correct address data in its fields that also require latitude and longitude data to be updated on saving. It uses pythons own default urllib and json, so no need to install 3rd party stuff to make it work. This method is preferred to getting it on the fly, due to the OVER_QUERY_LIMIT that you will get when parsing many address, this way means it stays up to day in the model and will update when any part of the address changes.
- Geolocation
- Geolocation on save
- Google Geolocation