I'm creating an Akhet (Pyramid) web application. How can one generate in a mako template the URL for a given Handler/view ?
I'm looking for the equivalent of Pylons' ${url(controller="users", view="list")
${url(controller="users", view="list")
Akhet exposes the URLGenerator object as a renderer global, so you can just use url('users', action='list'), assuming config.add_handler('users', '/users/{action}', ...) in your setup.
URLGenerator
url('users', action='list')
config.add_handler('users', '/users/{action}', ...)
http://docs.pylonsproject.org/projects/akhet/dev/api.html#module-akhet.urlgenerator
You need to use route_url. It's available in the templates in request.route_url.
<a href="${request.route_url('import')}">Import</a>
for example
Akhet exposes the
URLGenerator
object as a renderer global, so you can just useurl('users', action='list')
, assumingconfig.add_handler('users', '/users/{action}', ...)
in your setup.http://docs.pylonsproject.org/projects/akhet/dev/api.html#module-akhet.urlgenerator