For the life of me, I can\'t figure out how to pre-populate a BooleanField with WTForms. I have a field called \"active\". It defaults to being not checked, and it\'s not requ
To have the default boolean value as True, you need to set the default to "checked"
Basic fields Basic fields generally represent scalar data types with single values, and refer to a single input from the form.
class wtforms.fields.BooleanField(default field arguments, false_values=None)
Represents an input type="checkbox". Set the checked-status by using the default-option. Any value for default, e.g. default="checked" puts checked into the html-element and sets the data to True
Source
class QuestionForm(Form):
question = TextField('Question', [validators.Required()])
slug = TextField('Slug', [validators.Required()])
active = BooleanField('Active', default="checked")