How do you create a variable sized form in Flask?
Here is my forms.py:
from flask_wtf import Form
from wtforms import StringField, BooleanField, SelectField, TextField
from wtforms.validators import DataRequired
class TestForm(Form):
blanks = ....
test = []
foreach blank in blanks
test.append(TextField(blank, [validators.Length(min=5, max=70)]))
Here is my template:
<form action="" method="post" name="test">
{{ form.hidden_tag() }}
{% for test in form.tests %}
{{ test }}
{% endfor %}
<p><input type="submit" value="Test"></p>
</form>
It displays "TextField..." instead of displaying the actual HTML of the form input. What am I doing wrong? How should I be doing this correctly?