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 a data field is present in a response.
For more information, see condition.required.
Parameters | Type | Description |
---|---|---|
data | Optional[Any] | The data field. If it is not specified, the data of the parent component is used. |
hint | Optional[Any] | A hint that is shown if the condition is not met. |
Examples:
How to check that image is uploaded.
import toloka.client.project.template_builder as tbimage = tb.fields.MediaFileFieldV1( tb.data.OutputData('image'), tb.fields.MediaFileFieldV1.Accept(photo=True, gallery=True), validation=tb.conditions.RequiredConditionV1(hint='You must upload a photo.'),)
Last updated: August 28, 2023