You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{% do data.__setitem__(field.field_name, field.default) %}
{% endif %}
Suggestions
The docs and examples could have a friendly pointer on how to set defaults, such as:
There are three ways to choose a default value.
First, if required is set on a choices list, the first option will be selected. (HT @jqnatividad#265)
Second, the key default sets an explicit default, and works on any field. The value must be valid as per the field's datatype and validators, or exist in the choices.
Problem
I would like to set a default for some fields.
Research
Read README, examples, issues, browsed code, no definite pointer.
Searching the ckanext-scheming repo for "default" brought up
ckanext-scheming/ckanext/scheming/templates/scheming/package/snippets/resource_form.html
Lines 31 to 33 in d441d2d
Suggestions
The docs and examples could have a friendly pointer on how to set defaults, such as:
There are three ways to choose a default value.
First, if
required
is set on a choices list, the first option will be selected. (HT @jqnatividad #265)Second, the key
default
sets an explicit default, and works on any field. The value must be valid as per the field's datatype and validators, or exist in the choices.Third, field values can be supplied through GET request parameters to "Add dataset". (HT @wardi #258)
The text was updated successfully, but these errors were encountered: