Created
April 21, 2012 13:46
-
-
Save tioover/2437140 to your computer and use it in GitHub Desktop.
wtform field maker for jinja2 macro
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 field(field, cls='') -%} | |
<p>{{field.label()}}</p> | |
<p>{{field(class_ = cls)}}</p> | |
{%if field.errors%} | |
<ul class='errors'> | |
{%for error in field.errors%} | |
<li class='error'>{{error}}</li> | |
{%endfor%} | |
</ul> | |
{%endif%} | |
{%- endmacro %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment