Skip to content

Commit ba82339

Browse files
jorwoodsclaude
andcommitted
docs: add jobs.filter to api-ref.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f0502f3 commit ba82339

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

docs/api-ref.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,6 +2014,45 @@ See the `update_datasource_data.py` or `refresh.py` sample in the Samples direct
20142014
<br>
20152015
<br>
20162016

2017+
#### jobs.filter
2018+
2019+
```py
2020+
jobs.filter(**kwargs)
2021+
```
2022+
2023+
Returns a list of background jobs that match the specified filters. Fields and operators are passed as keyword arguments in the form `field_name=value` or `field_name__operator=value`.
2024+
2025+
**Supported fields and operators**
2026+
2027+
Field | Operators
2028+
:--- | :---
2029+
`args` | `has`
2030+
`completed_at` | `eq`, `gt`, `gte`, `lt`, `lte`
2031+
`created_at` | `eq`, `gt`, `gte`, `lt`, `lte`
2032+
`job_type` | `eq`, `in`
2033+
`notes` | `has`
2034+
`priority` | `eq`, `gt`, `gte`, `lt`, `lte`
2035+
`progress` | `eq`, `gt`, `gte`, `lt`, `lte`
2036+
`started_at` | `eq`, `gt`, `gte`, `lt`, `lte`
2037+
`status` | `eq`
2038+
`subtitle` | `eq`, `has`
2039+
`title` | `eq`, `has`
2040+
2041+
**Returns**
2042+
2043+
Returns a `QuerySet` of `BackgroundJobItem` objects.
2044+
2045+
**Example**
2046+
2047+
```py
2048+
failed_jobs = server.jobs.filter(status='Failed')
2049+
for job in failed_jobs:
2050+
print(job.id, job.type)
2051+
```
2052+
2053+
<br>
2054+
<br>
2055+
20172056
---
20182057

20192058
## Metadata

0 commit comments

Comments
 (0)