On 01/04/2012 06:03 AM, Christoph Zwerschke wrote: > Am 04.01.2012 12:01, schrieb Alessandro Molina: >> On Wed, Jan 4, 2012 at 11:08 AM, timblack1<[email protected]> wrote: >>> I'm unsure whether I should use url() in widget definitions. I get the >>> above error when I use url() and import the widget when the app loads >>> (outside a controller method, before a request hits the app), so I've >>> removed url() from my widget code. But is url() needed in the >>> widget code? >> >> Inside widgets you should use lurl instead of url. >> lurl calls are processed at render time instead of call time so they >> avoid access to request outside a request. > > Just noticed one peculiarity concerning this matter which is the > "link" parameter of resource widgets like CSSLink: When setting this > parameter, you should use neither url() nor lurl(), because > ToscaWidgets already does this for you and breaks lurl(). For all > other parameters, which are usually referenced and thereby stringified > in the widget templates, lurl() is the proper choice. Thanks, Christoph; my issue was the specific case of using the "link" parameter, so your answer solves my problem. I think, then, that these docs need to be updated accordingly: http://www.turbogears.org/2.1/docs/main/ToscaWidgets/forms.html?highlight=csslink.
Tim -- 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.

