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.

-- Christoph

--
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