Get selected text from a form using wtforms SelectField
问题 This is a question upon the use of wtforms SelectField . Once the form submitted, I wish to extract selected text. I have the following form: from wtforms import Form, SelectField class TestForm(Form): hour = SelectField(u'Hour', choices=[('1', '8am'), ('2', '10am') ]) Here's the view: @app.route('/', methods=['GET', 'POST']) def test_create(): form =TestForm(request.form) if request.method == 'POST' and form.validate(): test = Test() form.populate_obj(test) test.hour=form.hour.name db