From: Radek Czajka Date: Mon, 5 Apr 2021 13:03:23 +0000 (+0200) Subject: Fetch thumbnails from wikidata. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/149903ae7da0968ef3b1b0dc0f329afeaa5a7007 Fetch thumbnails from wikidata. --- 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): diff --git a/src/catalogue/templates/catalogue/book_text.html b/src/catalogue/templates/catalogue/book_text.html index 27601d87d..e10bc9689 100644 --- a/src/catalogue/templates/catalogue/book_text.html +++ b/src/catalogue/templates/catalogue/book_text.html @@ -182,7 +182,7 @@ {% localize off %}