Shouldn't I use turbogears.url() in controller.py?

3 views
Skip to first unread message

Olli

unread,
Aug 25, 2006, 9:27:20 PM8/25/06
to TurboGears
Hi, folks. I got a problem with webpath. take this example:

webpath = "test"

# if I use turbogears.url() in template files. works fine
http://test.com/test

# but when I use turbogears.url() in controller file. the webpath
become twice
http://test.com/test/test

# when I don't use turbogears.url() in controller file. set
turbogears.redirect("/") directly
http://test.com/test

So, what is the problem when I use turobgeats.url() in controller file?
OR, did I miss something? I think I'm confused about webpath.

Kevin Dangoor

unread,
Aug 29, 2006, 7:22:14 AM8/29/06
to turbo...@googlegroups.com
turbogears.redirect() already uses turbogears.url() behind the
scenes. Are you calling turbogears.url() and then passing that result
to redirect?

Kevin


--
Kevin Dangoor
TurboGears / Zesty News

email: k...@blazingthings.com
company: http://www.BlazingThings.com
blog: http://www.BlueSkyOnMars.com

Olli Wang

unread,
Aug 30, 2006, 8:40:00 PM8/30/06
to TurboGears
yes. I think that's what the problem I got. thanks, Kevin.

Damjan

unread,
Sep 6, 2006, 1:53:40 PM9/6/06
to TurboGears
> turbogears.redirect() already uses turbogears.url() behind the
> scenes. Are you calling turbogears.url() and then passing that result
> to redirect?

Maybe turbogears.url() should return a string-like object (instence of
a string subclass), so that you always know if a url is absolute or not.

Reply all
Reply to author
Forward
0 new messages