Pylons Tips

All scripts created by paster(paster create, paster controller and etc.) uses 4 spaces as indent while many editors(vim) uses tabs automatically. Different indent in one file will cause fatal error.

h.url_for is a popular helper function in many books and tutorials which to solve url mapping. This tool is no longer available by default since 0.97. If you got error message like “AttributeError: ‘module’ object has no attribute ‘url_for’”, just add

[codesyntax lang="python"]from routes import url_for[/codesyntax]
to yourapp/libs/helper.py .

This entry was written by Sunng , posted on Thursday July 02 2009at 09:07 pm , filed under 手艺 and tagged , , . Bookmark the permalink . Post a comment below or leave a trackback: Trackback URL.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word