Could we remove it from the docs?
It will be removed eventually, when all the remaining oldforms stuff is
removed (before 1.0). Also, there's a temporary freeze on docs changes
at the moment until the docs refactor lands.
Regards,
Malcolm
Validators are really only used by the admin in 0.96 (there was no
model-aware validation there). In 1.0, there will still be no
model-aware validation -- we pushed that to post-1.0 a little while ago
-- and the admin interface uses forms validation plus a couple of manual
checks for things like unique-together.
So there isn't a direct replacement for validator lists in 1.0.
Regards,
Malcolm
(other than just setting up the form used for your model in the admin
to have the validation you want, which isn't terribly hard and is how
this sort of stuff should have worked long ago)
--
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."
Michael
That is neither a direct nor indirect replacement for model-level validation.
Many applications receive input from sources other than forms. Validation at
the form and model level are both valuable, but for different reasons.
It is an indirect way to achieve something very close. Nothing requires
that the data you pass to a ModelForm class has to come from an HTML
form submission, so the restriction you mention doesn't actually
exist. :-)
So you can create a ModelForm, pass in a model instance, check
is_valid() and then carry on if things pass.
Is it a bit of a hack? Yes. Will it suffice for the time being until
model-validation is available? Also yes, since we don't have a choice.
Regards,
Malcolm
True, but Django has *never* supported model-level validation;
validator_list has always only been a shortcut for specifying some
validation logic that shows up in automatically-generated forms.