From 9daecbb4f7e4dbfa0a747147b525c468624de2be Mon Sep 17 00:00:00 2001 From: tirilane Date: Sun, 6 Mar 2011 18:03:05 +0000 Subject: [PATCH] =?UTF-8?q?Forbedring=20av=20#9=20og=20#10.=20Har=20repare?= =?UTF-8?q?rt=20sortering,=20slik=20at=20forfattere=20er=20sortert=20p?= =?UTF-8?q?=C3=A5=20navn,=20og=20b=C3=B8ker=20p=C3=A5=20=C3=A5r=20og=20tit?= =?UTF-8?q?tel.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python/web/library/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/web/library/views.py b/python/web/library/views.py index 09a7b36..fe91c50 100644 --- a/python/web/library/views.py +++ b/python/web/library/views.py @@ -10,7 +10,7 @@ relations = {'Author' : u'Forfatter', 'Illustrator' : u'Tegner', 'Translator' : # Create your views here. def BookView(request,book_identifier): book=get_object_or_404(Book,isbn=book_identifier) - people = book.persons.all().order_by('person') + people = book.persons.all().order_by('person__last_name', 'person__first_name') shelves = None global relations if book.category: @@ -38,7 +38,7 @@ def BookRedirect(request,book_identifier): def PersonView(request,person_identifier): global relations person = get_object_or_404(Person,id=person_identifier) - books = person.books.all().order_by('book') + books = person.books.all().order_by('book__published_year', 'book__title') contributed = {} for book in books: if str(book.relation) in relations: