Updated Choice type to allow for multiple choices #135

Merged
merged 4 commits into from Nov 17, 2016

Conversation

Projects
None yet
2 participants
@cimmanon
Contributor

cimmanon commented Oct 19, 2016

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:

cimmanon added some commits Oct 12, 2016

Updated Choice type to allow for multiple choices, allowing it to be …
…compatible with the multiple attribute for select elements
Added helpful error messages for choice and groupedChoice in place of…
… vague exceptions regarding unsafe use of head or !!
@jaspervdj

This comment has been minimized.

Show comment
Hide comment
@jaspervdj

jaspervdj Oct 27, 2016

Owner

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

Owner

jaspervdj commented Oct 27, 2016

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

@cimmanon

This comment has been minimized.

Show comment
Hide comment
@cimmanon

cimmanon Oct 27, 2016

Contributor

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

Contributor

cimmanon commented Oct 27, 2016

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

@jaspervdj

This comment has been minimized.

Show comment
Hide comment
@jaspervdj

jaspervdj Oct 31, 2016

Owner

Maybe selecting a number of Pokemon that the user likes?

Owner

jaspervdj commented Oct 31, 2016

Maybe selecting a number of Pokemon that the user likes?

@cimmanon

This comment has been minimized.

Show comment
Hide comment
@cimmanon

cimmanon Oct 31, 2016

Contributor

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

Contributor

cimmanon commented Oct 31, 2016

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

@cimmanon

This comment has been minimized.

Show comment
Hide comment
@cimmanon

cimmanon Nov 1, 2016

Contributor

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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@jaspervdj

jaspervdj Nov 17, 2016

Owner

This looks great now. Thanks for all the work!

Owner

jaspervdj commented Nov 17, 2016

This looks great now. Thanks for all the work!

@jaspervdj jaspervdj merged commit 8b61bc7 into jaspervdj:master Nov 17, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment