-
Notifications
You must be signed in to change notification settings - Fork 163
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
Why can't I store boolean values? #344
Comments
try adding an |
That worked! Why would I need to add this additional step instead of just adding a validator though? This really tripped me up, I completely missed them in the docs |
internally all extra dataset fields are stored as strings. The boolean case is pretty common, if you can think of a good way to add this to the docs the contribution would be very welcome! |
- stop using `select_boolean` to hack the data back to being a boolean from a string - instead use output_validators in order to transform the data from a string back to a boolean See ckan#344 for more
- stop using `select_boolean` to hack the data back to being a boolean from a string - instead use output_validators in order to transform the data from a string back to a boolean See ckan#344 for more
Finally found the time to add a quick example. I hope #347 helps! I didn't know exactly where to put it in the readme, so it is where it is. Will gladly move/modify as seems appropriate. Thanks |
My
ckan_dataset.yaml
How it looks in the CKAN form
How it gets stored in the API
WHY?
What's happening here? Is the boolean validator causing it to be set as a string "true" or "false"?
To get around this I've made a horrible hack to our select preset form and assigned it in the case where we have a ckan-scheming option that sets boolean values:
Marvell-Consulting@e7d050a#diff-eb6d8b864cdb6ac8796aa9745b925510d8f56c8d9b5b0ef29fa2a9965948b172
There must be a better way! What am I missing?!
The text was updated successfully, but these errors were encountered: