[Zope3-dev] Usage of actions in zope.formlib ... was: Re: Add flexibility to zope.formlib.form.EditFormBase

Michael Howitz mh at gocept.com
Wed May 9 02:51:27 EDT 2007


Hello,

thinking over the last posts and the usage of actions in zope.formlib  
in general, I would say:
We should search for a better way how to implement actions in formlib.

Why?
If you want to subclass an existing form class and change any  
behavior in an action handler method, you have to redelcare the  
action completely, including translation of the action title, the  
condition and eventually a validator. I think this is too much  
duplication because most of these redeclared parameters are only copy- 
paste (+ imports!) from the super class.

But I have no clever solution for this. My suggestion from the  
initial post (make usage of function applyChanges compatible with  
subclassing) is not a good solution because according to Fred Drake  
the validator should compute the normalized values, so changing  
things in applyChanges is too late. And my suggestion does not allow  
to use different normalizations for different actions in the same class.

Any ideas?

-- 
mac



More information about the Zope3-dev mailing list