I need more than one chained_validators in one schema.  Is this
possible?  I tried this:
class UserAddSchema(validators.Schema):
        password = validators.String(not_empty=True)
        passwordConfirm = validators.String(not_empty=True)
        chained_validators = [validators.FieldsMatch('passwordConfirm',
'password')]
        mytext= validators.String(not_empty=True)
        mytextConfirm= validators.String(not_empty=True)
        chained_validators2 = [MyTextValidator('mytext', 'mytextConfirm')]

The password validator works on its own and the MyTextValidator works
on its own as well.

Apparently there's some magic in the word 'chained_validators' because
if I change it from that word, the validator simply ignores it.  When I
comment out one of the chained_validators and changed the other one to
'chained_validators', it worked.  I'm aware that what I just said is
poorly worded, so this is what I mean:
class UserAddSchema(validators.Schema):
        password = validators.String(not_empty=True)
        passwordConfirm = validators.String(not_empty=True)
        #chained_validators = [validators.FieldsMatch('passwordConfirm',
'password')]
        mytext= validators.String(not_empty=True)
        mytextConfirm= validators.String(not_empty=True)
        chained_validators = [MyTextValidator('mytext', 'mytextConfirm')]


Does anyone know how to make 2 chained_validators in one schema?


Thanks in advance,

Frank


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to