Created
December 17, 2012 06:24
-
-
Save sunu/4316183 to your computer and use it in GitHub Desktop.
Flask: Wtform helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% macro render_field(field) %} | |
<dt>{{ field.label }} | |
<dd>{{ field(**kwargs)|safe }} | |
{% if field.errors %} | |
<ul class=errors> | |
{% for error in field.errors %} | |
<li>{{ error }}</li> | |
{% endfor %} | |
</ul> | |
{% endif %} | |
</dd> | |
{% endmacro %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment