Skip to content

Automatically add clean functionality for partially unique index constraints? #129

Description

@sjamaan

Django has no validation for unique indexes (see this part of the Django code). As far as I can tell, you can pretty easily query partially unique fields just as easily as you can query fully unique(_together) fields.

For projects we've been using our own hacked version of the django-partial-index plugin, which provides a mixin that adds validations for these kind of partial indexes. We could migrate away from this plugin and use standard Django indexes with conditions, if Binder model would extend full_clean to check partial indexes as well.

Also: Maybe make a PR for Django for this so in the long run we can drop this again?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions