Dynamic choices WTForms Flask SelectField
The main idea here is to assign the choices list to the field after instantiation. To do so you need to use argument coerce=int. The coerce keyword arg to SelectField says that we use int() to coerce form data. The default coerce is unicode(). Correct FormModel: class AddName(FlaskForm): name =StringField(‘Device name’, validators=[InputRequired(),Length(min=4, max=30)]) groupID = … Read more