﻿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
12636	Validation should allow excluded fields	Berislav Lopac	nobody	"As of 1.2 alpha 1, the ModelForm validation throws an UnresolvableValidationError in the situation where a required field is excluded in the Meta subclass. I understand the intent behind that, but I believe this is broken; luckily, there is a simple way to implement it a bit differently.

Form is not the same as the Model, and ModelForm is nothing but a shortcut to create a form that follows a Model's fields. If a field is hidden from a Form, it should not evaluate it, and the Model will take care of itself: if the field in question has null=False, the Model's save() method will throw an exception anyway.

Luckily, there is already a mechanism which can help us here: blank=True is used in admin to allow a value, so I think that it should be used with regular ModelForms as well. Currently, the only way to pass the validation is that the Model field has both blank=True and null=True, but this is not what we need here: we need a mechanism to separate form validation from the model.

So I propose that only the blank attribute is validated in the ModelForm for excluded fields: if blank=True a None value is allowed for excluded fields, otherwise a UnresolvableValidationError is thrown."		closed	Uncategorized	1.2-alpha		duplicate			Unreviewed	0	0	0	0	0	0
