X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/20dab67292ee0df4c1873b5277318f00c423598c..f17e5ab1f46f52b071f71c799dfa4c755f7c407e:/apps/catalogue/views.py diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index 556bae1fe..d9ae442aa 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -81,8 +81,13 @@ def book_list(request): orphans = [] books_by_author = SortedDict() + books_nav = SortedDict() for tag in models.Tag.objects.filter(category='author'): books_by_author[tag] = [] + if books_nav.has_key(tag.sort_key[0]): + books_nav[tag.sort_key[0]].append(tag) + else: + books_nav[tag.sort_key[0]] = [tag] for book in books_by_parent[None]: authors = list(book.tags.filter(category='author'))