#2248: tg.url() behaves differently than pylons.url()
------------------------+---------------------------------------------------
Reporter: Federico2 | Owner:
Type: defect | Status: new
Priority: normal | Milestone: 2.0
Component: TurboGears | Version: 2.0b5
Severity: normal | Keywords: tg.url pylons.url
------------------------+---------------------------------------------------
tg.url() is not
The following items in a Genshi template:
{{{
<a href="${tg.url('')}">link1</a>
<a href="${tg.url(['where','wolf'])}">link2</a>
<a href="${tg.url('',action='update')}">link3</a>
<a href="${tg.url('')}/update">link4</a>
<a href="${tg.url('') + '/update'}">link5</a>
}}}
Will generate:
{{{
<a href="">link1</a>
<a href="where/wolf">link2</a>
<a href="?action=update">link3</a>
<a href="/update">link4</a>
<a href="/update">link5</a>
}}}
While ${tg.url('')} and ${tg.url(action='update')} will return:
{{{
IndexError: list index out of range
>> ${tg.url()}
Module tg.controllers:737 in url view
<< """
args = list(args)
if isinstance(args[0], list):
args[0] = u'/'.join(args[0])
if args and isinstance(args[0], basestring):
>> if isinstance(args[0], list):
}}}
I'm running this code inside a subcontroller but I never get the absolute
URL.
--
Ticket URL: <http://trac.turbogears.org/ticket/2248>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "TurboGears Tickets" group.
This group is read-only. No posting by normal members allowed.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---