【问题标题】:Pylons/Routes Did url_for() change within templates?Pylons/Routes 模板中的 url_for() 是否发生了变化?
【发布时间】:2011-01-31 12:29:14
【问题描述】:

我收到一个错误:

GenerationException: url_for could not generate URL. Called with args: () {}

来自 mako 模板的这一行:

<p>Your url is ${h.url_for()}</p>

在我的 helpers.py 中,我确实有:

from routes import url_for

看着Routes-1.12.1-py2.6.egg/routes/util.py,我好像去了 它调用 _screenargs() 的行有误。

这是 Pylons 书中的简单功能。我做错了什么傻事?有新的 url_current() 吗?在哪里?

【问题讨论】:

    标签: python routes pylons mako


    【解决方案1】:

    我不知道url_for()(无参数)是否合法,但如果是合法的,这就是您所说的“url_current”,我相信new approach 是使用url对象,调用它的方法为url.current()

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-12-03
      • 2012-10-14
      • 2012-02-12
      • 1970-01-01
      • 2023-04-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多