From 1991170217f47d73f8794b5c303634fe9f83b198 Mon Sep 17 00:00:00 2001 From: cofin Date: Mon, 11 Nov 2024 07:01:39 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20litestar?= =?UTF-8?q?-org/advanced-alchemy@4f2a3454ea1aebb813ee51777b50ab2c59d8f99a?= =?UTF-8?q?=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _modules/advanced_alchemy/filters.html | 52 ++++++++++++++------------ reference/types.html | 2 +- searchindex.js | 2 +- 3 files changed, 31 insertions(+), 25 deletions(-) diff --git a/_modules/advanced_alchemy/filters.html b/_modules/advanced_alchemy/filters.html index b5cb94f..c5e74c7 100644 --- a/_modules/advanced_alchemy/filters.html +++ b/_modules/advanced_alchemy/filters.html @@ -428,7 +428,7 @@

Source code for advanced_alchemy.filters

                 lambda s: s.where(field <= on_or_before),
                 track_bound_values=True,
                 track_closure_variables=False,
-                track_on=[self.__class__.__name__, model, self.field_name, self.on_or_before],
+                track_on=[self.__class__.__name__, model.__name__, self.field_name, self.on_or_before],
             )
         if self.on_or_after is not None:
             on_or_after = self.on_or_after
@@ -436,7 +436,7 @@ 

Source code for advanced_alchemy.filters

                 lambda s: s.where(field >= on_or_after),
                 track_bound_values=True,
                 track_closure_variables=False,
-                track_on=[self.__class__.__name__, model, self.field_name, self.on_or_after],
+                track_on=[self.__class__.__name__, model.__name__, self.field_name, self.on_or_after],
             )
         return statement
@@ -500,14 +500,14 @@

Source code for advanced_alchemy.filters

                 lambda s: s.where(any_(values) == field),  # type: ignore[arg-type]
                 track_bound_values=True,
                 track_closure_variables=False,
-                track_on=[self.__class__.__name__, self.field_name, model],
+                track_on=[self.__class__.__name__, self.field_name, model.__name__],
             )
         values = self.values
         return statement.add_criteria(
             lambda s: s.where(field.in_(values)),
             track_bound_values=True,
             track_closure_variables=False,
-            track_on=[self.__class__.__name__, self.field_name, model],
+            track_on=[self.__class__.__name__, self.field_name, model.__name__],
         )
@@ -559,14 +559,14 @@

Source code for advanced_alchemy.filters

                 lambda s: s.where(any_(values) != field),  # type: ignore[arg-type]
                 track_bound_values=True,
                 track_closure_variables=False,
-                track_on=[self.__class__.__name__, self.field_name, model],
+                track_on=[self.__class__.__name__, self.field_name, model.__name__],
             )
         values = self.values
         return statement.add_criteria(
             lambda s: s.where(field.notin_(values)),
             track_bound_values=True,
             track_closure_variables=False,
-            track_on=[self.__class__.__name__, self.field_name, model],
+            track_on=[self.__class__.__name__, self.field_name, model.__name__],
         )
@@ -609,7 +609,7 @@

Source code for advanced_alchemy.filters

             lambda s: s.limit(limit).offset(offset),
             track_bound_values=True,
             track_closure_variables=False,
-            track_on=[self.__class__.__name__, limit, offset, model],
+            track_on=[self.__class__.__name__, limit, offset, model.__name__],
         )
@@ -648,7 +648,7 @@

Source code for advanced_alchemy.filters

             lambda s: s.order_by(fragment),
             track_bound_values=False,
             track_closure_variables=False,
-            track_on=[self.__class__.__name__, model, self.field_name, self.sort_order],
+            track_on=[self.__class__.__name__, model.__name__, self.field_name, self.sort_order],
         )
@@ -713,25 +713,31 @@

Source code for advanced_alchemy.filters

             lambda s: s.where(where_clause),
             track_bound_values=True,
             track_closure_variables=True,
-            track_on=[self.__class__.__name__, model, str(self.normalized_field_names), self.value, self.ignore_case],
-        )
+ track_on=[ + self.__class__.__name__, + model.__name__, + str(self.normalized_field_names), + self.value, + self.ignore_case, + ], + ) - - + +
[docs] -@dataclass -class NotInSearchFilter(SearchFilter): - """Data required to construct a ``WHERE field_name NOT LIKE '%' || :value || '%'`` clause.""" - - @property - def _operator(self) -> Callable[..., ColumnElement[bool]]: - return and_ - - @property - def _func(self) -> attrgetter[Callable[[str], BinaryExpression[bool]]]: - return attrgetter("not_ilike" if self.ignore_case else "not_like")
+
@dataclass +class NotInSearchFilter(SearchFilter): + """Data required to construct a ``WHERE field_name NOT LIKE '%' || :value || '%'`` clause.""" + + @property + def _operator(self) -> Callable[..., ColumnElement[bool]]: + return and_ + + @property + def _func(self) -> attrgetter[Callable[[str], BinaryExpression[bool]]]: + return attrgetter("not_ilike" if self.ignore_case else "not_like")