aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNavan Chauhan <navanchauhan@gmail.com>2021-06-03 23:45:31 +0530
committerNavan Chauhan <navanchauhan@gmail.com>2021-06-03 23:45:31 +0530
commitbbbf94169e0dddd88790c0907729a5f257f5ef5b (patch)
treec7cd7b757dd67d4bd6863b76980b87405f85a77a
parent42f0febd38f0427f33994b153c1a1d937afb609c (diff)
added form helper
-rw-r--r--app/templates/_formhelpers.html12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/templates/_formhelpers.html b/app/templates/_formhelpers.html
new file mode 100644
index 0000000..1aa63d0
--- /dev/null
+++ b/app/templates/_formhelpers.html
@@ -0,0 +1,12 @@
+{% macro render_field(field) %}
+ <dt>{{ field.label }}
+ <dd>{{ field(class="form-control",**kwargs)|safe }}
+ {% if field.errors %}
+ <ul class=errors>
+ {% for error in field.errors %}
+ <li>{{ error }}</li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+ </dd>
+{% endmacro %} \ No newline at end of file