#35234: ExclusionConstraint.expressions should be checked for foreign
relationship
references
------------------------------------------------+--------------------------
Reporter: Simon Charette | Owner: (none)
Type: Cleanup/optimization | Status: assigned
Component: contrib.postgres | Version: 5.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+--------------------------
Unlike `CheckConstraint.condition`, `UniqueConstraint.fields`,
`.expressions`, and `.include` the `ExclusionConstraint.expressions`
members are not checked for references to foreign tables to emit
`models.E041` on violation which [https://forum.djangoproject.com/t
/exclusionconstraint-with-expression-does-not-apply-migration/21574 has
been a source of confusion].
In order to avoid coupling the model constraint checks with third-party
application and allow any third-party application to provide their own
checks `Model._check_constraint` should delegate validation to
`BaseConstraint.check` like `_check_fields` delegates to `Field.check`.
Unfortunately `CheckConstraint` already defines a `.check` attribute which
I suggest we rename to `._check` internally (better name welcome) to avoid
collision with the proposed `BaseConstraint.check()` method and expose a
coherent interface.
--
Ticket URL: <https://code.djangoproject.com/ticket/35234>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018dbfce84e2-8d5f6f6a-9a28-4af4-8f0f-91b173ecd962-000000%40eu-central-1.amazonses.com.