On Fri, 24 Mar 2006 16:41:34 -0800
"Michele Cella" <[EMAIL PROTECTED]> wrote:

> 
> Baruch Even wrote:
> >
> > There was a link posted an hour ago to an application based on TG
> > released as Open Source, When I looked at the source they do
> > exactly what you ask for. But instead of adding the widget to the
> > dict passed they instantiate the widget inside the template. It
> > looks like a great way to do what you want.
> >
> 
> Mmm, I didn't noticed they are doing this, that's not how widgets are
> supposed to work.
> You should be able to reuse the same widget instance across multiple
> requests since widgets are stateless.
> 
> Anyway, back to the initial question, you can use variableProvider
> (soon to become variable_provider in 0.9a2 if I prepare the patch
> quickly) in this way I think (not tested):
> 
> from turbogears import view
> 
> view.variableProviders.append(my_widget_instance)
> 
> Ciao
> Michele

But variableProviders isn't read for retrieve_css and
retrieve_javascript (though, it'd be nice if it was... then this method
would be the official way to include widgets app-wide).

Jason

Attachment: signature.asc
Description: PGP signature

Reply via email to