X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/d18f17e7a8bdcafd4ef341b1cbe90c5c275a9dcb..f3872a90b13a88be0473e3ce3126240d0d5cbb74:/src/catalogue/models/collection.py?ds=inline diff --git a/src/catalogue/models/collection.py b/src/catalogue/models/collection.py index 412a976d4..f1a582cbe 100644 --- a/src/catalogue/models/collection.py +++ b/src/catalogue/models/collection.py @@ -56,6 +56,9 @@ class Collection(models.Model): from catalogue.models import Book return Book.objects.filter(self.get_query()) + def get_5_books(self): + return self.get_books()[:5] + @cached_render('catalogue/collection_box.html') def box(self): return {