xowiki::formfield::fc_to_dict (public)
xowiki::formfield::fc_to_dict form_constraints
Defined in packages/xowiki/tcl/form-field-procs.tcl
Convert from form_constraint syntax to a dict. This is just a partial implementation to be probably extended in the future. it expects that the type is the first element and ignores everything not in the syntax "*=*", or skips "@*" fields. Don't expect this to be fully reversible.
- Parameters:
- form_constraints (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- dict_to_xx
Source code: set result "" foreach fc $form_constraints { #ns_log notice "... fc_to_dict works on <$fc>" set p [string first : $fc] if {$p > -1} { set field_name [string range $fc 0 $p-1] set short_spec [string range $fc $p+1 end] if {[string match @* $field_name]} continue dict set result $field_name [spec_to_dict -name $field_name $short_spec] dict set result $field_name _definition $short_spec } else { ns_log warning "fc_to_dict: ignore invalid form-constraints entry <$fc>" } } return $resultXQL Not present: Generic, PostgreSQL, Oracle