furious-luke / django-address

A Django address model and field. Addresses may be specified by address components or by performing an automatic Google Maps lookup.
BSD 3-Clause "New" or "Revised" License
430 stars 180 forks source link

Customize options to geocomplete (like `type`) #66

Open jplehmann opened 7 years ago

jplehmann commented 7 years ago

Sometimes you don't want to allow a user to choose from any kind of location, but you want to scope it to a certain type (e.g., cities only). The JQuery Geocomplete API accepts a [type parameter](https://developers.google.com/maps/documentation/javascript/places?csw=1#place_search_requests) which gets passed though. It can be set to one of these [types](Places for autocomplete requests: https://developers.google.com/places/supported_types#table3).

This is very simple to implement and just requires an additional option to geocomplete.

Currently I have copied addresses.js into my code and customized it, but this issue is to generalize support for this option or maybe any option to avoid such hacking.

brianabrams commented 6 years ago

+1 It would also be extremely beneficial if the model included a 'Name' field for the business name when returning an 'establishment'.

banagale commented 4 years ago

Assigning this to 0.3.0 since it would require model architecture currently missing from master.