Validators are filters. So if the first validation does not pass, the
value does no get sent to the next.

You could do:

class CHECK_ALL(object):
    def __init__(self,*validators):
        self.validators=validators
    def __call__(self,value):
        errors = [e for e in [v(value)[1] for v in validators] if e]
        return (value,errors and ', '.join(errors) or None)

db.table.field.requires=CHECK_ALL(IS_XXX(),IS_YYY(),IS_ZZZ)()

but this only works if the IS_XXX, IS_YYY, IS_ZZZ ar validators that
do not do any filtering.


Massimo

On Jan 23, 6:23 am, Stefan Izota <[email protected]> wrote:
> Hi all,
>
> When using multiple validators per form field, the validation process
> stops when the first check fails.
> Is there a way to get all the field errors when validating a form?
>
> Thanks for your time,
> Stefan Izota

Reply via email to