add compound validators

Issue #74 resolved
Lorenzo Pierfederici
created an issue

compound validators like Any and All would be useful and would help in porting applications based on tw 0.9 that use the ones provided by formencode.

You can pull an implementation of compound validators from my fork: https://bitbucket.org/lento/tw2core

cheers, lorenzo

Comments (3)

  1. paj repo owner

    Ok, this does sound reasonable. Do you have any more uses cases?

    All - I can see you would sometimes, although your example seems a bit contrived. You can use multiple inheritence for the same effect, e.g. class EmailLengthValidator(StringLengthValidator, EmailValidator)

    Any - I can't think of any situation where you'd want to do this.

  2. Ralph Bean

    For `any` you could want someone's login information to be:

    • A valid username
    • A valid email address

    There's a case for you.

    I have a strong feeling that the fork is un-mergable due to how long this has been sitting around. I'll take a stab at cherry-picking the validators tomorrow.

  3. Log in to comment