List converted to Dropdown in Flask/WTForms
<p>Basically I have a list in Python and would like to programmatically call on and create a dropdown form from this list using WTForms into an HTML doc.  I can't figure out what I am missing here when trying to use the <strong>SelectField</strong> approach in WTForms. The list is within "updatef". </p>

<p>I get the error:  <strong>ValueError: need more than 1 value to unpack</strong>
when trying to run this.</p>

<pre><code>class ReusableForm(Form):  # Define the form fields and validation parameters
    updates = SelectField(u'Update Frequency', choices = updatef, validators = [validators.required()])


@app.route("/editor", methods=['GET', 'POST'])
def hello():
    form = ReusableForm(request.form)  # calls on form

        if request.method == 'POST':
            updates = request.form['updates']
</code></pre>

<p>HTML</p>

<pre><code>    &lt;form  id="main" action="" method="post" role="form" spellcheck="true"&gt;
    &lt;p&gt; {{ form.updates }} &lt;/p&gt;
</code></pre>

<p><code>choices</code> has to be a list of 2 value tuples such as <code>[(1,'Daily'),(2,'Weekly')]</code> - your error seems to suggest you might only have a list of values.</p>

python flask jinja2 wtforms flask-wtforms