coderholic / django-cities

Countries and cities of the world for Django projects
MIT License
921 stars 375 forks source link

Added customizable possibility to import cities without region #107

Closed eugena closed 8 years ago

coderholic commented 8 years ago

Can you give some details about why you want cities and not regions? Have you tested this with the city code? Pretty sure it'll break a bunch of code there.

coderholic commented 8 years ago

At the very least https://github.com/coderholic/django-cities/blob/master/cities/models.py#L102 would need to be updated

eugena commented 8 years ago

Thanks for your answer. The fact is that, we can't import all interesting cities. For instance, we've imported 39 cities instead of 1024 for Hong Kong! It's a problem for us, actually. That is why I've offered our unobtrusive patch ;-). Without CITIES_IGNORE_EMPTY_REGIONS = True everything will work as earlier.

About property, yes, a region will be None. Why not? This case can be processed later, in other layer.

coderholic commented 8 years ago

Ah ok, so this still imports regions, it just doesn't skip over cities where a region cannot be found?

eugena commented 8 years ago

Absolutely ;-)

coderholic commented 8 years ago

Cool, that makes a lot of sense :)