﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
35234	ExclusionConstraint.expressions should be checked for foreign relationship references	Simon Charette	Simon Charette	"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."	Cleanup/optimization	closed	contrib.postgres	5.0	Normal	fixed		David Sanders	Accepted	1	0	0	0	0	0
