I currently am creating a dynamic select field using WTFORMS, however it never submits and fails the validation with the following error.
Not a valid choice
My Field is created like this:
area = SelectField()
and in the view, i am grabbing the options from the db like so:
form = MytestForm()
form.area.choices = [(a.id, a.name) for a in Area.objects.all()]
It works however if i create static options.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…