Craig and Alessandro,

Thank you for your help.  I ended up doing as Alessandro suggested and 
passing urls/labels in the update_params method (Still in old TW).  All 
permission logic is handled in this method and only menu items that are 
visible to a particular user are passed.

I did try passing the entire tg module as Craig mentioned.  It worked, but 
I have no idea what performance or other penalty may be incurred.  I guess 
it boils down to where you want to do the majority of your menubar logic, 
and I am happy to keep it out of the template.

- Shane

On Saturday, May 4, 2013 7:36:16 AM UTC-5, Craig Small wrote:
>
> On Sat, May 04, 2013 at 12:27:34AM +0200, Alessandro Molina wrote: 
> >    as you already noticed widgets are rendered in a different context 
> from 
> >    the page templates, widgets templates are usually not meant for doing 
> much 
> >    computation. You should prepare everything you need inside the 
> template 
> >    inside the "prepare" method of the widget. 
> If you really need tg.url in your widget, do a hack like this in prepare 
> self.url = tg.url 
> the template can then use w.url 
>
> Alessandro is probably right though. 
>
>  - Craig 
>
> -- 
> Craig Small VK2XLZ   http://enc.com.au/          csmall at : enc.com.au 
> Debian GNU/Linux     http://www.debian.org/      csmall at : debian.org 
> GPG fingerprint:     5D2F B320 B825 D939 04D2  0519 3938 F96B DF50 FEA5 
>

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


Reply via email to