mjanez / ckanext-schemingdcat

Improved ckanext-scheming with DCAT, DCAT-AP and GeoDCAT-AP/INSPIRE custom schemas and tools.
https://github.com/mjanez/ckan-docker
GNU Affero General Public License v3.0
0 stars 2 forks source link

Fix - Fix schema/components output_validators for multiple fields #16

Closed mjanez closed 1 year ago

mjanez commented 1 year ago

Internally all extra fields are stored as strings. If you are attempting to save and restore other types of data you will need to use output validators.

For example if you use a simple "yes/no" question, you will need to let ckanext-scheming know that this data needs to be stored and retrieved as a boolean. This is acheieved using validators and output_validators keys.

 - field_name: is_camel_friendly
   label: Is this camel friendly?
   required: true
   preset: select
   choices:
     - value: false
       label: "No"
     - value: true
       label: "Yes"
   validators: scheming_required boolean_validator
   output_validators: boolean_validator

Info: https://github.com/ckan/ckanext-scheming#output_validators

Schemas

Components of ckan-docker deployment