I'm trying to use Mako with webpy0.3, as described here:
http://webpy.org/cookbook/template_mako
It works great, except that I can't pass **locals() to render. It
raises a TypeError and says: render() got multiple values for keyword
argument 'self'.
Has anyone else run across this? Is there a workaround besides copying
locals() and deleting self? (I really like passing **locals.)
Using mako 0.2.3 (latest) webpy 0.3 (latest) from 12/03/08 (commit:
622a5ed26a6aa406e6c9a3d4f3fbdbfbddad6aae).
Thanks,
-Zack
## file: code.py
import web
from web.contrib.template import render_mako
urls = ('/', 'trouble')
app = web.application(urls, globals(), autoreload=True)
render = render_mako(directories=['templates'],
input_encoding='utf-8', output_encoding='utf-8')
class trouble():
def GET(self):
abc = 'abc'
return render.trouble(abc=abc) ## This works...
# return render.trouble(**locals()) ## This doesn't work!
if __name__ == '__main__': app.run()
## file: trouble.html
This is easy as ${abc}!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---