[Zope-dev] z3c.form update issues

Roger Ineichen dev at projekt01.ch
Sat Feb 21 13:40:39 EST 2009


Hi Dan  

> Betreff: Re: [Zope-dev] z3c.form update issues
> 
> 2009/2/21 Roger Ineichen <dev at projekt01.ch>:
> > Hi all
> >
> > I fixed a z3c.form issue where util.Manager keys and values 
> get append 
> > more then one time by calling update more then once on widgets or 
> > actions.
> >
> > For doing so, I implemented a UniqueOrderedKeys class for 
> > util.Manager._data_keys and a decorator which will prevent 
> to override 
> > them. See z3c.form.util.py line: 120
> >
> > Can you please review if this and let me know it this is compatible 
> > with our own z3c.form parts?
> >
> > My motivation to deep into this is to find a better way how 
> we use the 
> > update track. I think we should separate the update process into a 
> > setup and execute concept. I have the feeling, but could not really 
> > tell it right now, that we need to separate execute for prevent 
> > calling execute more then once during calling update.
> >
> > Update should get called more then once at least if it comes to 
> > calculate button/handler conditions. Because it's possible that an 
> > action execute call manipulates something which will change 
> the button 
> > condition which we need to recalculate within an action update call.
> >
> > Any hints/ideas about that. Or do you know a good use case for this 
> > problem. It also smells to me that the MultiWidget or the 
> > ObjectWidgets implementation could be more robust within a better 
> > update/execute concept.
> 
> IIRC, the update and execute phases are already separated for 
> actions (you call actions.update() for setup and 
> actions.execute() for actual
> execting) and that fact is used in MultiWidget and many custom forms.

Yes, I think we should carefully review this part and probably
add action.update after action.execute. Right now, without looking
at the code I think we do not update actions after execute. Which
could end in bad action handler setup because of skipped action
condition handling after execute actions.

I'll see later if I take another look at that part.

Regards
Roger Ineichen
_____________________________
END OF MESSAGE

> --
> WBR, Dan Korostelev
> 



More information about the Zope-Dev mailing list