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: