jaspervdj / digestive-functors

A general way to consume input using applicative functors
149 stars 71 forks source link

Updated Choice type to allow for multiple choices #135

Closed cimmanon closed 7 years ago

cimmanon commented 7 years ago

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:

jaspervdj commented 7 years ago

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

cimmanon commented 7 years ago

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

jaspervdj commented 7 years ago

Maybe selecting a number of Pokemon that the user likes?

cimmanon commented 7 years ago

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

cimmanon commented 7 years ago

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.

jaspervdj commented 7 years ago

This looks great now. Thanks for all the work!