﻿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
20867	Allow Form.clean() to target specific fields when raising ValidationError.	loic84	loic84	"The goal would be to unlock the following API:

{{{
def clean(self):
    errors = {}
    if condition1:
        errors['field1'] = ValidationError('message1', code='code')
    if condition2:
        errors['field2'] = ValidationError('message2', code='code')
    raise ValidationError(errors)
}}}

Most of the groundwork has been done for #20199.

We would need to document passing a `dict` to `ValidationError`, just like we already document passing a `list` in [https://docs.djangoproject.com/en/dev/ref/forms/validation/#raising-validationerror ref/forms/validation/#raising-validationerror].

This would probably deprecate or reduce the need for the pattern discussed in [https://docs.djangoproject.com/en/dev/ref/forms/validation/#form-subclasses-and-modifying-field-errors ref/forms/validation/#form-subclasses-and-modifying-field-errors].

Refs #20199 #16986.
"	New feature	closed	Forms	dev	Normal	fixed		hv@…	Accepted	1	0	0	0	0	0
