[Zope3-Users] formlib validators

David Johnson djohnson at jsatech.com
Sun May 7 14:40:15 EDT 2006


Has anyone used formlib validators?  What is the proper technique? I do not
seem to be having any success.  Here is a validator that I wrote that seems
to do nothing (the success method is not called, and the form is redisplayed
without errors).  Basically it looks like the validator is being executed,
but that it is not returning the proper format for errors.  What is the
proper way to generate a validation error?  

 

    def checkFields(self,action,data):

        self.getFormFields()

        errs = self.validate(None,data)

        if len(errs) > 0 :

            return errs

        errs = []

        if self.context.isRegistered(self.login):

            print "Login in use"

            err = WidgetInputError('login',u'Login',LoginInUse())

            errs.append(err)

        return errs

 

 

 

--

David Johnson

djohnson at jsatech.com

201 Main Street Suite 1320

Fort Worth, TX 76102

(877) 572-8324 x2200

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope3-users/attachments/20060507/112373a7/attachment.htm


More information about the Zope3-users mailing list