typesystem
typesystem copied to clipboard
Add `MultipleChoice` field.
Display as a <select multiple>
Seems like this could either subclass Choice or inherit from Field directly. Do you have a preference? Also, I'm thinking it should include "min selected" and "max selected" as options. Anything else?
I'm happy to work on other fields/issues first if they're higher priority.
I'd suggest:
- Subclass
Field. - Don't include min selected / max selected, at least for the initial pass. That can come later.
We'll want to think carefully about null and empty behaviors, eg:
- We won't want to render an initial blank
<choice>in the multiple case. - Forms with no values selected won't submit any value at all. For consistency we probably want
MultipleChoice(default=[])to be the typical usage - similar toBooleanField(default=False)being the correct way to have a checkbox that acts asFalseif it does not submit a value.