[Zope-dev] z3c.form pass context to multi widgets in MultiConverter

Roger Ineichen dev at projekt01.ch
Wed Jul 8 08:52:53 EDT 2009


Hi Gerhard

> Betreff: Re: AW: [Zope-dev] z3c.form pass context to multi 
> widgets in MultiConverter

[...]

> > If this makes sense, the patch should probably do soemthing like:
> >
> > if not widget.ignoreContext
> >     widget.context = widget.form.context
> >
> > This whould prevent to set an ignored context from 
> self.widget.context 
> > to the widget.context.
> >
> >
> > I'm really not sure if this is working, but does this make 
> sense to you?
> >
> > Regards
> > Roger Ineichen
> >
> >
> >
> >   
> Thanks for the comment. For this particular use case it won't 
> work without the context,. The context is used to look up 
> further objects in the containment hierarchy. At this 
> particular part in the code it is just about converting 
> from/to widget/field value. So ignoreContext/ignoreRequest 
> are not used anyway. (at least not to retrieve widget values).
> 
> However, maybe it would be better to pass ignoreContex and 
> ignoreRequest to the sub-widget, and let the sub-widget 
> decide whether to ignore the context/request or not. This 
> could especially be useful in other parts of the muti-widget code.

Yes good idea, this makes sense to me. Can you commit this to the
trunk with a test?

Regards
Roger Ineichen
_____________________________
END OF MESSAGE



More information about the Zope-Dev mailing list