[Zope3-Users] Function for validation

Stephan Richter srichter at cosmos.phy.tufts.edu
Sun Sep 11 11:01:37 EDT 2005


On Sunday 04 September 2005 12:14, Florian Lindner wrote:
> I use a view class for a addform. IIRC there is a defined name for a
> function in the view class that is called form zope in order to validate
> the input. I thought its name were validate. But in my viewclass
>
> class AddForm(object):
>     def validate():
>         import pdb
>         pdb.set_trace()
>
> Is never called.
>
> What is its name?

No, it's not that easy, because the validate method is never called 
explicitly. Please study the zope.app.form.browser.add.AddForm class 
carefully to see how it is done. You will see that the template calls the 
update() method which in turn does all the validation, value setting, etc.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training


More information about the Zope3-users mailing list