How do you set a default value for a WTForms SelectField?
I believe this problem is caused by the Field‘s data attribute overriding the default with something that WTForms doesn’t understand (e.g. a DB model object — it expects an int). This would happen if you have populated your form in the constructor like so: form = PostForm(obj=post) the solution is to manually set the data … Read more