Pylons Webhelperでエラーが発生する



新しくPylons環境を作成し、アプリケーションを
移行したのですが、起動時

/usr/local/lib/python2.5/site-packages/Pylons-0.9.6.2-py2.5.egg/pylons/middleware.py:11: DeprecationWarning: The webhelpers.rails package is deprecated.
- Please begin migrating to the new helpers in webhelpers.html,
webhelpers.text, webhelpers.number, etc.
- Import url_for() directly from routes, and redirect_to() from
pylons.controllers.util (if using Pylons) or from routes.
- All Javascript support has been deprecated. You can write link_to_remote()
yourself or use one of the third-party Javascript libraries.
from webhelpers.rails.asset_tag import javascript_path


というエラーが発生しました。


警告だろうと思い、動かしてみたのですが、


<type 'exceptions.AttributeError'>: 'module' object has no attribute 'form'


起動時の警告どおり、webhelperが使用できなくなっているようです。


調べてみると、ここにヒントがありました。
最短で 0.9.6 プロジェクトを 0.9.7 で動かす方法

うーん。pylonsは0.9.6.2を指定してインストールしたのですが、
webhelpersの最新があたると駄目なのでしょうか。

書いてあるとおり、
'lib/helpers.py'に

from webhelpers.rails import *


と、importを追加すると動いてくれました。


pylonsの0.9.7にバージョンアップする際は、
色々変更されるようですね。


どのタイミングでバージョンアップするか悩みどころです。




もどる