I made a SelectField like this:
# constants.py
QUESTION_LIST = {}
QUESTION_LIST['QuestionOne'] = { 'disagree-strong': "Strongly Disagree", 'agree-strong': "Strongly Agree" }
#forms.py
from constants import *
typeone = SelectField('QuestionOne',
choices=QUESTION_LIST['QuestionOne'].iteritems(),
description='Answer the question')
So when you load the page, it shows the choices. I pick the choice, press submit and it says "this is not a valid choice" and it blanks out the select field.
Then when you refresh the page, it's as if the code is broken and it doesn't show choices anymore... It's an empty dropdown/select field.
What am I doing wrong?
EDIT: For some reason, when you put the iteritems in the view instead of the form ,everything works. Some sort of quirk with Flask-WTF where if you don't use their format it seems to delete the choices after you submit form.