@@ -55,18 +55,14 @@ def find_all(cls: type[_T]) -> Iterator[_T]:
5555 def find_by (cls : type [_T ], ** parameters ) -> Iterator [_T ]:
5656 if not parameters :
5757 raise ValueError ("missing query conditions" )
58- return recursive_fetch (
59- cls , cls .__table__ .select_where (** parameters )
60- )
58+ return recursive_fetch (cls , cls .__table__ .select_where (** parameters ))
6159
6260 @classmethod
6361 def find (cls : type [_T ], * , pk : int ) -> _T :
6462 try :
6563 return next (cls .find_by (pk = pk ))
6664 except StopIteration as ex :
67- raise ValueError (
68- f"{ cls .__name__ } with pk={ pk } not found"
69- ) from ex
65+ raise ValueError (f"{ cls .__name__ } with pk={ pk } not found" ) from ex
7066
7167 def save (self ) -> None :
7268 if self .pk is None :
@@ -221,9 +217,7 @@ def create(self) -> SQLQuery:
221217 )
222218
223219 def insert (self , record : _T ) -> SQLQuery :
224- column_names = ", " .join (
225- column .name for column in self .table .columns
226- )
220+ column_names = ", " .join (column .name for column in self .table .columns )
227221 placeholders = ", " .join (
228222 f":{ column .name } " for column in self .table .columns
229223 )
@@ -237,8 +231,7 @@ def insert(self, record: _T) -> SQLQuery:
237231
238232 def update (self , record : _T ) -> SQLQuery :
239233 placeholders = ", " .join (
240- f"{ column .name } =:{ column .name } "
241- for column in self .table .columns
234+ f"{ column .name } =:{ column .name } " for column in self .table .columns
242235 )
243236 return SQLQuery (
244237 (
0 commit comments