Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostalCode unique key contais id + othee fields #213

Open
ihor-nahuliak opened this issue Aug 4, 2019 · 0 comments
Open

PostalCode unique key contais id + othee fields #213

ihor-nahuliak opened this issue Aug 4, 2019 · 0 comments

Comments

@ihor-nahuliak
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant