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

PostalCode unique key contais id + othee fields

Open ihor-nahuliak opened this issue 6 years ago • 0 comments
trafficstars

Postal code mode has strange unique keys: https://github.com/coderholic/django-cities/blob/master/cities/models.py#L347

@python_2_unicode_compatible
class PostalCode(Place, SlugModel):
    # ...
    class Meta:
        unique_together = (
            ('country', 'region', 'subregion', 'city', 'district', 'name', 'id', 'code'),
            ('country', 'region_name', 'subregion_name', 'district_name', 'name', 'id', 'code'),
        )

Id field is already unique as primary key. What is the sense of these 2 unique keys above?

ihor-nahuliak avatar Aug 04 '19 23:08 ihor-nahuliak