#28405: CICharField on a ModelFormSet doesn't catch unique constraint violations
with different capitalization
----------------------------------+------------------------------------
Reporter: Jon Dufresne | Owner: (none)
Type: Bug | Status: new
Component: contrib.postgres | Version: 1.11
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+------------------------------------
Comment (by Simon Charette):
I feel like the underlying issue here is that the formset logic is not
relying on the database to determine unicity of values like a model form
does through `Model.validate_unique`.
Having `CICharField` and friends return a subclass of `str` that
implements `__eq__(self, other): self.casefold() == other.casefold()` as
suggested in #28405 would solve the issue for these fields but that not
for case-insensitive collations (#23964) and any other kind of non-
injective functional unique index. The same thing can be said about
[https://github.com/django/django/pull/7615 database level constraints].
--
Ticket URL: <https://code.djangoproject.com/ticket/28405#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.96eab245751f92a8f090016183cce888%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.