ListFieldV1

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

ListFieldV1(
self,
data: Optional[BaseComponent] = None,
render: Optional[BaseComponent] = None,
*,
button_label: Optional[Any] = None,
direction: Optional[Union[BaseComponent, ListDirection]] = None,
editable: Optional[Union[BaseComponent, bool]] = None,
max_length: Optional[Union[BaseComponent, float]] = None,
size: Optional[Union[BaseComponent, ListSize]] = None,
hint: Optional[Any] = None,
label: Optional[Any] = None,
validation: Optional[BaseComponent] = None,
version: Optional[str] = '1.0.0'
)

A component that allows a Toloker to add and remove list items, such as text fields to fill in.

This way you can allow a Toloker to give multiple answers to a question.

The list items can contain any component, including a list of other components. For example, this allows you to create a table where you can add and delete rows.

To add a new list item, the Toloker clicks the button. To remove an item, they click on the x on the right (it appears when hovering over a list item).

To prevent a Toloker from adding too many list items, set the maximum list length. You can also use the editable property to block Tolokers from changing a component, like when a certain event occurs.

Parameters Description

ParametersTypeDescription
dataOptional[BaseComponent]

Data with values that will be processed or changed.

renderOptional[BaseComponent]

Interface template for list items, such as a text field. In nested field.* components, use data.relative for recording responses, otherwise all the list items will have the same value.

button_labelOptional[Any]

Text on the button for adding list items.

directionOptional[Union[BaseComponent, ListDirection]]

The direction of the list.

editableOptional[Union[BaseComponent, bool]]

A property that indicates whether adding and removing list items is allowed. Set false to disable. By default it is True (allowed).

max_lengthOptional[Union[BaseComponent, float]]

Maximum number of list items.

sizeOptional[Union[BaseComponent, ListSize]]

The distance between list items. Acceptable values in ascending order: s, m (default).

hintOptional[Any]

Hint text.

labelOptional[Any]

Label above the component.

validationOptional[BaseComponent]

Validation based on condition.

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