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

Model structure precludes addresses with no localities/states #15

Open furious-luke opened 9 years ago

furious-luke commented 9 years ago

It occurs to me that some addresses may not have a state or locality (actually, I'm not sure this is true). It might be necessary to allow address without one or both of these. This will require a bit of a look at the model structure.

LennyLip commented 9 years ago

may be models must support xAL format?

furious-luke commented 9 years ago

That looks interesting, thanks!

LennyLip commented 9 years ago

I found only java implementation https://github.com/Geomatys/geotoolkit/tree/master/modules/jaxb-xml-binding/geotk-xml-kml/src/main/java/org/geotoolkit/xal/xml/v20 and https://github.com/citygml4j/citygml4j/tree/master/src/org/citygml4j/model/xal (looks better)

also xAL (simple version) using in android http://developer.android.com/reference/android/location/Address.html, source https://github.com/android/platform_frameworks_base/blob/master/location/java/android/location/Address.java

LennyLip commented 9 years ago

another approach is create sql schema from xal.xsd (for example, using Altova XMLSpy) and run django inspectdb to create models from DB.

I'm trying to do it now

furious-luke commented 9 years ago

The latest version of django-address, 0.2 (still on the dev branch) will no longer be troubled by this issue. The code now constructs dynamic hierarchies of address components based on Google's results from geocoding.

jplehmann commented 3 years ago

We just spent 1 week migrating off the dev branch, only to find that this issue exists on master, and apparently has never been addressed.

Copenhagen, Denmark is an example.

This issue needs to be re-opened. @banagale

banagale commented 3 years ago

Sorry to hear that, John, that has to be frustrating.

I've re-opened it. Do you have a test available for this failing behavior by any chance?

jplehmann commented 3 years ago

Rob thanks for the quick response.

I don't have a unit test, but I have a test case... as mentioned "Copenhagen, Denmark".

We haven't thought about this that much, but our plans at the moment are:

  1. First try to hack the Javascript so that the input always includes at least "UNKNOWN" as a state. This sounds like it might just work.
  2. If that doesn't work and/or later, to create a patch for the lib which supports unknown states by creating an "unknown" entity.

Open to other ideas too.