Skip to main content

Module group_source

Module group_source 

Source
Expand description

Choices from a repeated group (schema.md, “Choices from a repeated group”).

A choice field whose items is a group source { from, label? } takes its choices from the rows of a repeated group of the same form. This module checks the declaration and reads the choices from the data; the generator lists them and the validator checks a value against them (validation-rules.md, “Values”).

Structs§

GroupChoice
One choice of a group source: the canonical text of a row’s value and its label text.

Enums§

GroupChoicesError
Why the choices of a group source could not be read.

Functions§

group_choices
The choices of a group source for the root data: one per row of the group in data order whose value gives a non-empty canonical text, each value once, labelled with the text of its label field or else its value. A group missing from the data gives no choices.
group_source_failure
The message of the first rule that the group source of field at the declaration path breaks under the root properties, or None. The members of items are checked in declaration order, then the field, then from, the type of its field, label and then the type of its field.
group_source_repeat
The input failure message of the first row of a checked group source, in data order, whose choice value repeats a literal choice (CUSC-089) or that of an earlier row (CUVR-087), or None. A source whose from is not of the declared shape has no rows.
is_group_source
Whether items is a group source: an object with the member from.
scalar_child
Whether child renders one scalar value: an object whose type is not group, that has no properties member, is not repeated and has no lang.