|
|
@ -85,8 +85,10 @@ Here's an example `_formhelpers.html` template with such a macro: |
|
|
|
<dt>{{ field.label }} |
|
|
|
<dt>{{ field.label }} |
|
|
|
<dd>{{ field(**kwargs)|safe }} |
|
|
|
<dd>{{ field(**kwargs)|safe }} |
|
|
|
{% if field.errors %} |
|
|
|
{% if field.errors %} |
|
|
|
<ul class="errors"> |
|
|
|
<ul class=errors> |
|
|
|
{% for error in field.errors %}<li>{{ error }}{% endfor %} |
|
|
|
{% for error in field.errors %} |
|
|
|
|
|
|
|
<li>{{ error }}</li> |
|
|
|
|
|
|
|
{% endfor %} |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
{% endif %} |
|
|
|
{% endif %} |
|
|
|
</dd> |
|
|
|
</dd> |
|
|
@ -106,7 +108,7 @@ takes advantage of the `_formhelpers.html` template: |
|
|
|
.. sourcecode:: html+jinja |
|
|
|
.. sourcecode:: html+jinja |
|
|
|
|
|
|
|
|
|
|
|
{% from "_formhelpers.html" import render_field %} |
|
|
|
{% from "_formhelpers.html" import render_field %} |
|
|
|
<form method="post" action="/register"> |
|
|
|
<form method=post action="/register"> |
|
|
|
<dl> |
|
|
|
<dl> |
|
|
|
{{ render_field(form.username) }} |
|
|
|
{{ render_field(form.username) }} |
|
|
|
{{ render_field(form.email) }} |
|
|
|
{{ render_field(form.email) }} |
|
|
|