Prefetch specific model instances

This reduces the number of queries performed during delete, slightly.
pull/8321/head
Jake Howard 2022-04-06 14:33:02 +01:00 zatwierdzone przez Matt Westcott
rodzic ee03f9d975
commit 20336adfaf
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -559,8 +559,8 @@ class Page(AbstractPage, index.Indexed, ClusterableModel, metaclass=PageBase):
user=user,
deleted=True,
)
for child in self.get_descendants():
log_deletion(child.specific, user)
for child in self.get_descendants().specific():
log_deletion(child, user)
log_deletion(self.specific, user)
# this is a Page instance, so carry on as we were