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

formatted_address is unavailable before get_details() #122

Open
danFromTelAviv opened this issue Nov 8, 2018 · 0 comments
Open

formatted_address is unavailable before get_details() #122

danFromTelAviv opened this issue Nov 8, 2018 · 0 comments

Comments

@danFromTelAviv
Copy link

Hi,
Thanks for this amazing wrapper. It is so much better than google's api.

using the following code :

query_result = google_places.text_search(
            query="random place", lat_lng={"lat": 33.5, "lng": -86.8}, radius=100)

for idx, place in enumerate(query_result.places)
    print(place.formatted_address) 

give the following error :

googleplaces.GooglePlacesAttributeError: The attribute requested is only available after an explicit call to get_details() is made.

When using google's api directly this information is available without the additional get_details().
I worked around this by adding self.place_data = place_data to the Place class. I then call place.place_data.formatted_address instead of place.formatted_address and that works fine.

How would you suggest to implement this in a more proper way.

Thanks again

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