Skip to content

Region is None for City model object #195

@aliev

Description

@aliev

Checklist

Hello,

Is it possible to make relation between cities and regions? Seems region field is None

Steps to reproduce

In [1]: from cities.models import City

In [2]: City.objects.filter(name='Athens')
Out[2]: <QuerySet [<City: Athens>, <City: Athens>, <City: Athens>, <City: Athens>, <City: Athens>, <City: Athens>]>

In [3]: [(x.country, x.region) for x in City.objects.filter(name='Athens')]
Out[3]: 
[(<Country: Greece>, None),
 (<Country: United States>, None),
 (<Country: United States>, None),
 (<Country: United States>, None),
 (<Country: United States>, None),
 (<Country: United States>, None)]

Regions is exists:

In [1]: from cities.models import Region, City

In [2]: Region.objects.count()
Out[2]: 3918

In [7]: City.objects.filter(region__isnull=False)
Out[7]: <QuerySet []>

Version of cities: django-cities==0.5.0.6

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions