On Tue, Apr 18, 2006 at 10:28:38AM -0400, Gary Poster wrote:
> >Perhaps it's overkill to write adapter for all my content objects. I think
> >I found a solution. The Request object might be RO but I can smuggle an
> >reference inside the reponse headers and removed it after all the widgets are
> augh! :-)
> Philipp is leading you correctly. I might even be tempted to write a
> custom form that directly set the data for the widgets myself; maybe that
> would be a quicker and easier approach to the same road.
That's what I did. I used formlib to create widgets, added an attribute
containing the information I needed to send from the view to the widgets.
It worked like a charm - until I used some more complex data structures
(Lists, Dicts). I don't know a way of adding attributes to the subwidgets
of e.g. ListWidgets because those subwidgets are created on the fly during
the ListWidgets' rendering/query-parsing process.
> If you still don't want to listen to him, please don't do the response
> hack you are talking about. the request has an `annotations` attribute
> which experts can use to stash things away. Beware: this is a road that
> has bitten many in Zope 2, and is easily abused.
I would really like always to use the Zope(tm) way. I'll try the annotations
attribute (although I'm not really an expert :-) ).
Zope3-users mailing list