How do you set a default value for a WTForms SelectField?

后端 未结 7 638
-上瘾入骨i
-上瘾入骨i 2020-11-29 04:09

When attempting to set the default value of a SelectField with WTForms, I pass in value to the \'default\' parameter like so.

class TestForm(Form):
  test_fi         


        
7条回答
  •  我在风中等你
    2020-11-29 04:50

    The first way you posted is correct, and it works for me. The only explanation for it not working can be that you are running an older version of WTForms, it worked for me on 1.0.1

提交回复
热议问题