X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/67df302167539474edd02b57c2e8bd30349d7625..5b4d95336fc553b86811abf3a6c0c0607a46faab:/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'))