field = forms.Field(......)
field.clean = lambda value: [x(value) for x in
myModelField.validator_list] and value
Current logic in BaseForm.full_clean checks for
newforms.util.ValidationError only, rendering any model fields'
validators useless.
I suppose, newforms.util.ValidationError extend
core.validators.ValidationError, or full_clean should wait also for
core.validators.ValidationError.
I haven't filled a ticket yet, because I thought the matter should be
discussed here first.
Regards,
Max
Hi Max,
django.core.validators is going away in the long term. Use
django.newforms if you want your code to be forwards-compatible.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
> Use django.newforms if you want your code to be forwards-compatible.
Sure. But why not to use the [one] validators set (or at least, one
exception class) in the long term, both in models and forms?
What to do with the validators that are used in models, including
builtin? Model.validate is still uses core.validators, BTW. Is
validation in models also going away in the long term?
Regards,
Max
Hey Max,
Things are in flux with newforms right now, as they've been for a
while, so the only thing I can say is, please be patient. We're aware
of the fact that things are in flux, and, speaking as a perfectionist,
chances are that it bothers me even more than it bothers you. :)
> Things are in flux with newforms right now, as they've been for a
> while, so the only thing I can say is, please be patient. We're aware
> of the fact that things are in flux, and, speaking as a perfectionist,
> chances are that it bothers me even more than it bothers you. :)
Thanks for clarification!
Hacking a lot with newforms these days. Great stuff. MultiValueField/
MultiWidget are awesome.
Will do my best to help. Found some bugs, the patches will be soon at
trac.
Max