X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/9b8b01f5d27d66386597a8789d921f3a2c630e09..fb10f5b89c782ff4e25d0100e09a8c1ba4002de7:/apps/catalogue/views.py?ds=inline diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index e7df9bc5d..617d19f94 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -214,6 +214,13 @@ def book_detail(request, slug): tags = list(book.tags.filter(~Q(category='set'))) categories = split_tags(tags) book_children = book.children.all().order_by('parent_number') + + _book = book + parents = [] + while _book.parent: + parents.append(_book.parent) + _book = _book.parent + parents = reversed(parents) theme_counter = book.theme_counter book_themes = models.Tag.objects.filter(pk__in=theme_counter.keys())