@@ -47,14 +47,29 @@ async def get(self, identifier: PRIMARY_KEY) -> MODEL:
4747 :return: A model instance
4848 :raises ModelNotFound: No model has been found using the primary key
4949 """
50- # TODO: implement get_many()
5150 ...
5251
53- async def delete (self , entity : Union [MODEL , PRIMARY_KEY ]) -> None :
52+ async def get_many (self , identifiers : Iterable [PRIMARY_KEY ]) -> List [MODEL ]:
53+ """Get a list of models by primary keys.
54+
55+ :param identifiers: A list of primary keys
56+ :type identifiers: List
57+ :return: A list of models
58+ :rtype: List
59+ """
60+ ...
61+
62+ async def delete (self , instance : MODEL ) -> None :
5463 """Deletes a model.
5564
56- :param entity: The model instance or the primary key
57- :type entity: Union[MODEL, PRIMARY_KEY]
65+ :param instance: The model instance
66+ """
67+ ...
68+
69+ async def delete_many (self , instances : Iterable [MODEL ]) -> None :
70+ """Deletes a collection of models in a single transaction.
71+
72+ :param instances: The model instances
5873 """
5974 ...
6075
@@ -188,14 +203,29 @@ def get(self, identifier: PRIMARY_KEY) -> MODEL:
188203 :return: A model instance
189204 :raises ModelNotFound: No model has been found using the primary key
190205 """
191- # TODO: implement get_many()
192206 ...
193207
194- def delete (self , entity : Union [MODEL , PRIMARY_KEY ]) -> None :
208+ def get_many (self , identifiers : Iterable [PRIMARY_KEY ]) -> List [MODEL ]:
209+ """Get a list of models by primary keys.
210+
211+ :param identifiers: A list of primary keys
212+ :type identifiers: List
213+ :return: A list of models
214+ :rtype: List
215+ """
216+ ...
217+
218+ def delete (self , instance : MODEL ) -> None :
195219 """Deletes a model.
196220
197- :param entity: The model instance or the primary key
198- :type entity: Union[MODEL, PRIMARY_KEY]
221+ :param instance: The model instance
222+ """
223+ ...
224+
225+ async def delete_many (self , instances : Iterable [MODEL ]) -> None :
226+ """Deletes a collection of models in a single transaction.
227+
228+ :param instances: The model instances
199229 """
200230 ...
201231
0 commit comments