On 10/7/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> >To me it seems like it should be an error if there's no validation_error
> >method and any validators are given.  This way the error is caught early
> >during development.
>
> Yes, but there are sometimes(many times I would say) "soft-errors" that
> don't need this kind of handling. A typical case would be the fields
> may come in as nothing(None) which can be a don't care and proceed.

Validation errors should be genuine errors. If it's valid for a value
to be empty, the validators should be configured that way...

> defining validation_error would grab the control of it without giving
> it a chance to go on. And I re-read the code, what validation_error
> received is not the original function, but the name of the function,
> making calling it back a bit difficult.

I had originally passed in the name to make it easy to do ifs on.
Calling it back is not that difficult

getattr(self, methodname)(params)

I'm going to think about Ian's suggestion of on_error... that sounds
possibly pleasant. There's definitely some more thought that needs to
go into validation to make it easier to use.

Kevin

Reply via email to