Skip to content

Commit 3a51061

Browse files
author
Alc-Alc
committed
chore(hack?): move to private property
1 parent 7be034c commit 3a51061

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

advanced_alchemy/filters.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from dataclasses import dataclass
88
from datetime import datetime # noqa: TCH003
99
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
1111

1212
from sqlalchemy import BinaryExpression, and_, any_, or_, text
1313

@@ -293,7 +293,9 @@ class SearchFilter(StatementFilter):
293293
ignore_case: bool | None = False
294294
"""Should the search be case insensitive."""
295295

296-
_operator: ClassVar[Callable[..., ColumnElement[bool]]] = or_
296+
@property
297+
def _operator(self) -> Callable[..., ColumnElement[bool]]:
298+
return or_
297299

298300
@property
299301
def _func(self) -> attrgetter[Callable[[str], BinaryExpression[bool]]]:
@@ -333,7 +335,9 @@ def append_to_lambda_statement(
333335
class NotInSearchFilter(SearchFilter):
334336
"""Data required to construct a ``WHERE field_name NOT LIKE '%' || :value || '%'`` clause."""
335337

336-
_operator: ClassVar[Callable[..., ColumnElement[bool]]] = and_
338+
@property
339+
def _operator(self) -> Callable[..., ColumnElement[bool]]:
340+
return and_
337341

338342
@property
339343
def _func(self) -> attrgetter[Callable[[str], BinaryExpression[bool]]]:

0 commit comments

Comments
 (0)