Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Choice type to allow for multiple choices #135

Merged
merged 4 commits into from Nov 17, 2016

Conversation

cimmanon
Copy link
Contributor

Choice now takes a list of selected values rather than a single value. This allows the multiple attribute to be used for select elements when using one of the 8 new formlet functions. It can potentially be used to generate a list of checkboxes within View generating libraries (Heist, Blaze, etc.) as well.

This directly addresses the following issues:

And indirectly or partially addresses the following issues:

…compatible with the multiple attribute for select elements
… vague exceptions regarding unsafe use of head or !!
@jaspervdj
Copy link
Owner

Looks good to me. Would it be possible to add a test as well though? Thanks for your work @cimmanon!

@cimmanon
Copy link
Contributor Author

Do you have any ideas for one that will fit the Pokemon theme?

@jaspervdj
Copy link
Owner

Maybe selecting a number of Pokemon that the user likes?

@cimmanon
Copy link
Contributor Author

There, I've added a test that allows you to set multiple weaknesses for a Pokemon.

@cimmanon
Copy link
Contributor Author

cimmanon commented Nov 1, 2016

Hm, commit 26e6ce5 is causing the "choice expects a list with at least one item in it" error to be emitted in one of my forms that fetches the choice options from the database. Closing this until I can figure out where the problem is.

@cimmanon cimmanon closed this Nov 1, 2016
@cimmanon cimmanon reopened this Nov 1, 2016
@jaspervdj
Copy link
Owner

This looks great now. Thanks for all the work!

@jaspervdj jaspervdj merged commit 8b61bc7 into jaspervdj:master Nov 17, 2016
@cimmanon cimmanon deleted the choice-multiple branch October 22, 2018 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants