Skip to main content

Module attributes

Module attributes 

Source
Expand description

Custom attributes (feature 5): definitions maintained by administrators and the validation of values against them.

Values live in revisions.attributes (JSON object by key), so they are versioned with the revision like name, material and mass: frozen once released, copied by revise and Save as. The key and the data type of a definition never change after it was created; label, unit, choices, item types, order and the active flag do. Deactivating keeps stored values visible, it only stops offering the attribute.

Structs§

AttributeSettings
The editable part of a definition.

Functions§

applies_to
Whether the definition applies to items of item_type.
create
Creates a definition (administrators).
for_item_type
Active definitions for items of item_type – the fields of the forms.
get
get_by_key
list
All definitions in display order; active_only leaves out deactivated ones.
update
Changes label, unit, choices, item types, order and the active flag (administrators). Key and data type stay.
usage
How many revisions store a value of the attribute.