diff --git a/CHANGELOG.md b/CHANGELOG.md index 1743456..fd16222 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.45.0] - 2025-09-14 +## Added +Exists form field filter + ## [2.44.0] - 2025-08-26 ## Added Position to TableRow entity diff --git a/pyrus/models/entities.py b/pyrus/models/entities.py index ef7cf1f..d984670 100644 --- a/pyrus/models/entities.py +++ b/pyrus/models/entities.py @@ -1213,6 +1213,20 @@ def __init__(self, field_id): __init__(field_id=field_id, operator='is_empty', values=[]) +class ExistsFilter(FormRegisterFilter): + """ + Form register exists filter + + Attributes: + field_id (:obj:`int`): Form field id + """ + + def __init__(self, field_id): + _validate_field_id(field_id) + super(ExistsFilter, self). \ + __init__(field_id=field_id, operator='exists', values=[]) + + class TaskList: """ task list diff --git a/pyrus/models/requests.py b/pyrus/models/requests.py index decb9ac..a54802a 100644 --- a/pyrus/models/requests.py +++ b/pyrus/models/requests.py @@ -86,6 +86,8 @@ def __init__(self, steps=None, include_archived=None, filters=None, modified_bef setattr(self, 'fld{}'.format(fltr.field_id), ",".join(str(x) for x in fltr.values)) if fltr.operator == 'is_empty': setattr(self, 'fld{}'.format(fltr.field_id), 'empty') + if fltr.operator == 'exists': + setattr(self, 'fld{}'.format(fltr.field_id), '*') if isinstance(fltr, entities.FormRegisterTaskIdFilter): if fltr.operator == 'equals': setattr(self, 'id', fltr.values) diff --git a/pyrus/version.py b/pyrus/version.py index 49b84f0..a61f5e3 100644 --- a/pyrus/version.py +++ b/pyrus/version.py @@ -1 +1 @@ -VERSION = "2.44.0" +VERSION = "2.45.0"