StrParam
String param
Attributes
PRIVATE_VISIBILITY: Literal
PROTECTED_VISIBILITY: Literal
PUBLIC_VISIBILITY: Literal
additional_info: Optional
allowed_values: Optional
default_value: Optional
human_name: Optional
optional: bool
short_description: Optional
unit: Optional
visibility: Literal
Functions
If a value is provided there is no need to set the optional
Setting optional to True, allows default None value
Parameters:
Name | Type | Default value | Description |
---|---|---|---|
default_value | Optional | Default value, if none, and optional is false, the config is mandatory | |
min_length | Optional | ||
max_length | Optional | ||
optional | bool | False | See default value optional[str] |
visibility | Literal | public | Visibility of the param, see doc on type paramspecvisibilty for more info paramspecvisibilty |
human_name | Optional | Human readable name of the param, showed in the interface [str] | |
short_description | Optional | Description of the param, showed in the interface [str] | |
allowed_values | Optional | If present, the param value must be in the array [list[str]] | |
unit | Optional | Measure unit of the value (ex kg) [str] |
Method 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.
Parameters:
Name | Type | Default value | Description |
---|---|---|---|
value | Any |
Return type:
Any |
Return type:
ParamSpecType |
Return type:
ParamSpecDTO |
Validate 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.l
Parameters:
Name | Type | Default value | Description |
---|---|---|---|
value | Any |
Return type:
str |
Return type:
ParamSpec |
Return type:
str |
Parameters:
Name | Type | Default value | Description |
---|---|---|---|
spec_dto | ParamSpecDTO |
Return type:
ParamSpec |