RadioGroupFieldV1

toloka.client.project.template_builder.fields.RadioGroupFieldV1 | Source code

RadioGroupFieldV1(
self,
data: Optional[BaseComponent] = None,
options: Optional[Union[BaseComponent, List[Union[BaseComponent, GroupFieldOption]]]] = None,
*,
disabled: Optional[Union[BaseComponent, bool]] = None,
hint: Optional[Any] = None,
label: Optional[Any] = None,
validation: Optional[BaseComponent] = None,
version: Optional[str] = '1.0.0'
)

A component for selecting one value out of several options.

For more information, see field.radio-group.

Parameters description

ParametersTypeDescription
dataOptional[BaseComponent]

A data path.

optionsOptional[Union[BaseComponent, List[Union[BaseComponent, GroupFieldOption]]]]

A list of options.

disabledOptional[Union[BaseComponent, bool]]

Disabling the component:

  • False — Selecting an option is allowed.
  • True — Selecting an option is disabled.

Default value: False.

hintOptional[Any]

A hint.

labelOptional[Any]

A label above the component.

validationOptional[BaseComponent]

Validation rules.

Examples:

import toloka.client.project.template_builder as tb
radio_group_field = tb.fields.RadioGroupFieldV1(
data=tb.data.OutputData(path='result'),
options=[
tb.fields.GroupFieldOption('Cat', 'cat'),
tb.fields.GroupFieldOption('Dog', 'dog'),
],
validation=tb.conditions.RequiredConditionV1()
)

Last updated: August 28, 2023

Toloka-Kit
OverviewGetting API keyQuick start
Recipes
Reference
toloka.client
toloka.async_client
toloka.autoquality [autoquality]
toloka.metrics
toloka.streaming