python - Can webpy form work well with jinja2? -


as cookbook of webpy , jinja2, can use webpy's form or jinja2 independently. when try combining both in template file below, not work:

template file:

$def with(form) {% extends 'layout.html' %} {% block maincontents %} <h1>user</h1> <form method="post">     $:form.render() </form> {% endblock %} 

part of python code:

render = render_jinja(     'templates',     encoding='utf-8', )  class test:     def post(self):         pass      def get(self):         f = user_form()         return render.test(f) 

$:form.render() templetor rendering instruction, taken verbatim docs, presume.

i believe should use jinja2 syntax, like

<form method="post">     {{ form.render() | safe }} </form> 

disclaimer: haven't tested snippet above.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -