Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fill related models upon Address creation. #184

Open
mrxsal opened this issue Dec 22, 2022 · 0 comments
Open

Fill related models upon Address creation. #184

mrxsal opened this issue Dec 22, 2022 · 0 comments

Comments

@mrxsal
Copy link

mrxsal commented Dec 22, 2022

It seems to me that the only way to use Google's API to populate related models such as Locality, State, Country, is when a user clicks on an option in the AddressField widget.

Can I automate this server-side when i only have access to the raw address?

For example, I'd like to do something like this:

address = Address('somewhere-in-amsterdam')
address.save()

instance.address = address
instance.save()
>>> instance.address.locality
Amsterdam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant