SelectParam
Param restricted to a fixed set of choices, rendered as a select / dropdown in the interface.
This replaces the deprecated options argument of :class:StrParam,
:class:IntParam and :class:FloatParam.
The options argument accepts three forms:
an :class:
~enum.Enumclass: one option per member, the membernameis the displayed label and the membervalueis stored / returned.a list mixing the two following forms:
- a raw value (
"a",1,2.5, ...): the value is both the stored value and the displayed label. - a
{"label": ..., "value": ...}dict (a :class:SelectParamOption): the interface showslabelbutvalueis stored / returned.
- a raw value (
When multiple is True, several choices can be selected and the param
value is a list of the selected values. In that case, if no
default_value is provided, the param defaults to an empty list [] (and
is therefore optional).
PRIVATE_VISIBILITY: LiteralPROTECTED_VISIBILITY: LiteralPUBLIC_VISIBILITY: Literaladditional_info: dict | Nonedefault_value: Optionalhuman_name: str | Noneinvalid_reason: str | Noneis_valid: booloptional: boolshort_description: str | Nonevisibility: Literaltype[enum.Enum] | list[typing.Union[typing.Any, gws_core.config.param.select_param.SelectParamOption]] | tuple[typing.Union[typing.Any, gws_core.config.param.select_param.SelectParamOption], ...] | Nonebool - FalseOptionalbool - FalseLiteral - publicstr | Nonestr | NoneMethod call before the value is used (in task or view) to apply some transformation if needed by the ParamSpec. This does not affect the value in the database.
AnyAnyAnyParamSpecDTOParamSpecSimpleDTOValidate the value of the param and return the modified value if needed. This method is called when the param is set in the config before saving it in the database. The returned value must be serializable in json.
AnyAnyParamSpecParamSpecTypeParamSpecDTObool - FalseParamSpec