If f is a MultiSelectField, then when the form is submitted the type of
f.value() depends on whether none, one or more than one option was
If none was selected, f.value() is None. This makes sense and works with
the NotEmpty validator as opposed to the RequiredField validator.
But if one option was selected, f.value() is type string and is equal to
whatever was selected, whereas if more than one option was selected,
f.value() is type list, with members being strings for the options
I find this unfortunate, or at least I can't understand why this design
decision was made. Why doesn't f.value() always be a list (if not None),
and just have one element (the single string) if only one option was
Currently, since I treat the field value uniformly whether there is one
or more than one option, I have to do a "if type(f.value()) ==
type(""):" and create a single element list before processing it. (My
initial assumption that the value is always a list was a confusing
mistakeg to track down, since you can iterate over strings...)
I would rather test the length of the list if I need to know that than
the type of the return.
Please explain if this was intentionally designed this way - would it be
a bad idea for me to modify FormKit to behave as I describe?