coderholic / django-cities

Countries and cities of the world for Django projects
MIT License
913 stars 377 forks source link

PostalCode unique key contais id + othee fields #213

Open ihor-nahuliak opened 4 years ago

ihor-nahuliak commented 4 years ago

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?