Diez, fyi - I couldn't figure out how to create a new tmpl_context
variable as you recommended, however I managed to get it working
adequately by passing the sites (based on resource selection) to the
template and updating child_args.

Thanks for your help.

Rgds,
Michael




On Apr 19, 2:33 am, "Diez B. Roggisch" <[email protected]> wrote:
> On Monday, April 18, 2011 04:38:48 pm mpearce wrote:
>
> > Thanks Diez, if I try the first option, how can I access the site
> > field from the controller? Would this be via child_args in the
> > template? Not sure what you mean by tmpl_context-variable.
>
> No, there is the tmpl_context that you import from tg, and which serves as a
> thread/request-local storage. Roughly like this:
>
> from tg import tmpl_context as c
>
> # pass this as options
> def get_site_values():
>        return c.the_site_values
>
> @expose(...)
> def mycontroller(self, ..):
>        c.the_site_values = [site-values]
>
> HTH,
>
> Diez

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to