From c0e291c5dd478e584d78f4c37b6c4d5a828ed6a1 Mon Sep 17 00:00:00 2001 From: Ethon Date: Fri, 14 Jan 2022 23:18:33 +0800 Subject: [PATCH] fix the question in comment --- ormar/queryset/queryset.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ormar/queryset/queryset.py b/ormar/queryset/queryset.py index 85283bf..3747223 100644 --- a/ormar/queryset/queryset.py +++ b/ormar/queryset/queryset.py @@ -1080,7 +1080,7 @@ class QuerySet(Generic[T]): Bulk operations do not send signals. - :param objects:list of ormar models + :param objects: list of ormar models :type objects: List[Model] :param columns: list of columns to update :type columns: List[str] @@ -1135,8 +1135,7 @@ class QuerySet(Generic[T]): for obj in objects: obj.set_save_status(True) - entity = list(objects)[0] - await entity.signals.post_bulk_update.send( - sender=entity.__class__, instances=objects + await self.__class__.signals.post_bulk_update.send( + sender=self.__class__, instances=objects )