django-address icon indicating copy to clipboard operation
django-address copied to clipboard

Model structure precludes addresses with no localities/states

Open furious-luke opened this issue 9 years ago • 8 comments

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.

furious-luke avatar Jan 02 '15 22:01 furious-luke

may be models must support xAL format?

LennyLip avatar Mar 17 '15 08:03 LennyLip

That looks interesting, thanks!

furious-luke avatar Mar 17 '15 11:03 furious-luke

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 avatar Mar 17 '15 11:03 LennyLip

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

LennyLip avatar Mar 17 '15 19:03 LennyLip

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.

furious-luke avatar Nov 03 '15 01:11 furious-luke

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

jplehmann avatar Nov 04 '21 21:11 jplehmann

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?

banagale avatar Nov 04 '21 22:11 banagale

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.

jplehmann avatar Nov 04 '21 22:11 jplehmann