X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/d66f9960d12d739c44a89d1d4e013f52783097e7..01fd09f3c7d265ad5debb7e4fc78ab17ec7341b6:/src/catalogue/models/book.py?ds=sidebyside diff --git a/src/catalogue/models/book.py b/src/catalogue/models/book.py index 5a0f1696f..978bca4f2 100644 --- a/src/catalogue/models/book.py +++ b/src/catalogue/models/book.py @@ -677,6 +677,10 @@ class Book(models.Model): entity.save() Reference.objects.filter(book=self).exclude(entity__uri__in=found).delete() + @property + def references(self): + return self.reference_set.all().select_related('entity') + @classmethod @transaction.atomic def repopulate_ancestors(cls):