RequiredConditionV1

toloka.client.project.template_builder.conditions.RequiredConditionV1 | Source code

RequiredConditionV1(
self,
data: Optional[Any] = None,
*,
hint: Optional[Any] = None,
version: Optional[str] = '1.0.0'
)

Checks that the data is filled in. This way you can get the Toloker to answer all the required questions.

If used inside the validation property, you can omit the data property and the same property will be used from the parent component field (the one that contains the condition.required component).

Parameters Description

ParametersTypeDescription
dataOptional[Any]

Data to be filled in. If the property is not specified, the data of the parent component (the one that contains condition.required) is used.

hintOptional[Any]

Validation error message that a Toloker will see.

Examples:

How to check that image is uploaded.

image = tb.fields.MediaFileFieldV1(
tb.data.OutputData('image'),
tb.fields.MediaFileFieldV1.Accept(photo=True, gallery=True),
validation=tb.conditions.RequiredConditionV1(hint='Your must upload photo.'),
)
Toloka-Kit
OverviewGetting OAuth tokenQuick start
Recipes
Reference
toloka.client
toloka.async_client
toloka.autoquality [autoquality]
toloka.metrics
toloka.streaming