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

City and postal code relationship

Open jeromecaisip opened this issue 6 years ago • 5 comments

Why does the city property of the postal_code object return None or the city.postal_code.all() retruns an empty queryset.? I did --import=all. Did I miss anything on the setup?

jeromecaisip avatar Oct 04 '18 19:10 jeromecaisip

I am facing same issue/

MySecondLanguage avatar Jul 24 '22 10:07 MySecondLanguage

same... can't tell what i'm doing it wrong either. Also on the admin page, postal would hangs on individual postal_code.

[edit]: I think I find out the cause; from default the city_id isn't populated for example:

postgres@/tmp:abc> select city_id from cities_postalcode where code='012312';
+---------+
| city_id |
|---------|
| <null>  |
+---------+

chrislan815 avatar May 12 '23 23:05 chrislan815