[Zope3-Users] Re: formlib validators

S.Martin s.martin at iwm-kmrc.de
Mon May 8 09:02:50 EDT 2006


Hi David,

> Has anyone used formlib validators?  What is the proper technique? I do 
> not seem to be having any success.

i use formlib validator in the following way:

class ChangePassword(form.PageForm):

     def validate_change_passwd(self, action, data):
         errors = self.validate(action, data)
         # test password
         if not errors:
             if data['password'] != data['confirmPassword']:
                 errors = (_(u"Password and confirmation didn't match"),)
         return errors

     @form.action(u"Change", validator=validate_change_passwd)
     def handle_change_passwd(self, action, data):
	#...


Stefan Martin




More information about the Zope3-users mailing list