Toloka documentation

TaskSortItems

toloka.client.search_requests.TaskSortItems

TaskSortItems(self, items=None)

Keys for sorting tasks in search results.

Parameters Description

Parameters Type Description
items Optional[List[SortItem]]

A list of sorting keys. Supported values:

  • 'id' — The ID of a task.
  • 'created' — The creation date of a task.

Examples:

The example shows how to find tasks sorted by creation dates in descending order. Tasks with equal creation dates are sorted by IDs in ascending order.

sort = toloka.client.search_requests.TaskSortItems(['-created', 'id'])
result = toloka_client.find_tasks(pool_id=my_pool_id, sort=sort, limit=10)