X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/0ee9de179914aa395f4b7475b7b9b6229c42b760..a296a8f386a1641187b481b63f5b9a3efc583219:/apps/catalogue/views.py?ds=inline 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'))