identity and templates

0 views
Skip to first unread message

Mike Sarahan

unread,
Jan 11, 2006, 9:52:05 AM1/11/06
to TurboGears
Hi all, but especially Jeff Watkins -

I've noticed that for identity-restricted methods, the new,
less-specific means of identifying the template to be used (i.e.
".templates.templatename") doesn't work. I must still specify
"projectname.templates.templatename", otherwise I get an error about
module "templates" not existing.

-Mike

Jeff Watkins

unread,
Jan 11, 2006, 9:58:46 AM1/11/06
to turbo...@googlegroups.com

Mike, I noticed that last night, but I thought it was just lack of
sleep. It only seems to have a problem after authenticating. I wonder
whether it has anything to do with the order of the decorators...

Jeff

Jeff Watkins

unread,
Jan 11, 2006, 10:19:05 AM1/11/06
to turbo...@googlegroups.com
Jeff Watkins wrote:
> Mike, I noticed that last night, but I thought it was just lack of
> sleep. It only seems to have a problem after authenticating. I wonder
> whether it has anything to do with the order of the decorators...

In fact it does: _execute_func pulls the __module__ attribute of the
funcion, however, if the function is decorated, the __module__ will be
incorrect. You can also demonstrate this problem by including an
inputform or validators parameter to the expose decorator (because
expose decorates your function with validate internally).

Is there no way to introspect the decorator chain? I suppose not because
we're using closures here... but I wouldn't be surprised if someone's
solved this.

Jeff

--
Jeff Watkins
http://newburyportion.com/

Jeff Watkins

unread,
Jan 11, 2006, 10:25:17 AM1/11/06
to turbo...@googlegroups.com
Jeff Watkins wrote:
> In fact it does: _execute_func pulls the __module__ attribute of the
> funcion, however, if the function is decorated, the __module__ will be
> incorrect. You can also demonstrate this problem by including an
> inputform or validators parameter to the expose decorator (because
> expose decorates your function with validate internally).

Ticket #388.

Reply all
Reply to author
Forward
0 new messages