|
7 | 7 | from dataclasses import dataclass
|
8 | 8 | from datetime import datetime # noqa: TCH003
|
9 | 9 | from operator import attrgetter
|
10 |
| -from typing import TYPE_CHECKING, Any, ClassVar, Generic, Literal, TypeVar, cast |
| 10 | +from typing import TYPE_CHECKING, Any, Generic, Literal, TypeVar, cast |
11 | 11 |
|
12 | 12 | from sqlalchemy import BinaryExpression, and_, any_, or_, text
|
13 | 13 |
|
@@ -293,7 +293,9 @@ class SearchFilter(StatementFilter):
|
293 | 293 | ignore_case: bool | None = False
|
294 | 294 | """Should the search be case insensitive."""
|
295 | 295 |
|
296 |
| - _operator: ClassVar[Callable[..., ColumnElement[bool]]] = or_ |
| 296 | + @property |
| 297 | + def _operator(self) -> Callable[..., ColumnElement[bool]]: |
| 298 | + return or_ |
297 | 299 |
|
298 | 300 | @property
|
299 | 301 | def _func(self) -> attrgetter[Callable[[str], BinaryExpression[bool]]]:
|
@@ -333,7 +335,9 @@ def append_to_lambda_statement(
|
333 | 335 | class NotInSearchFilter(SearchFilter):
|
334 | 336 | """Data required to construct a ``WHERE field_name NOT LIKE '%' || :value || '%'`` clause."""
|
335 | 337 |
|
336 |
| - _operator: ClassVar[Callable[..., ColumnElement[bool]]] = and_ |
| 338 | + @property |
| 339 | + def _operator(self) -> Callable[..., ColumnElement[bool]]: |
| 340 | + return and_ |
337 | 341 |
|
338 | 342 | @property
|
339 | 343 | def _func(self) -> attrgetter[Callable[[str], BinaryExpression[bool]]]:
|
|
0 commit comments