﻿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
37502	Document which constraints model formsets validate across forms	Clifford Gama	Clifford Gama	"Model formsets validate unique, unique_together, unique_for_date|month|year, and UniqueConstraints with fields and no condition across forms in the formset (#9493, #30581). This is only mentioned in passing, in [https://docs.djangoproject.com/en/6.1/topics/forms/modelforms/#overriding-clean-on-a-modelformset Overriding clean() on a ModelFormSet], as the reason to call `super().clean()`. That passage lists only the first three. The `UniqueConstraint` support added in #30581 was never documented for formsets.

The docs also don't say:
- that `violation_error_message` isn't used for cross-form errors; a generic ""Please correct the duplicate data for …"" message is shown instead;
- that other constraints (conditional or expression-based `UniqueConstraint`s, `ExclusionConstraint`) are checked only against existing rows, not across forms, so saving can raise `IntegrityError`.

[https://github.com/django/django/pull/19249 PR]

Thanks Tim Schilling for the nudge to revive this work."	Cleanup/optimization	assigned	Documentation	dev	Normal		ModelFormSet, formset		Unreviewed	1	0	0	0	0	0
