Projects/worblehat-old
Projects
/
worblehat-old
Archived
12
0
Fork 0

Forbedring av #9 og #10. Har reparert sortering, slik at forfattere er sortert på navn, og bøker på år og tittel.

This commit is contained in:
Tiril Anette Langfeldt Rødland 2011-03-06 18:03:05 +00:00
parent 79c73b2502
commit 9daecbb4f7
1 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@ relations = {'Author' : u'Forfatter', 'Illustrator' : u'Tegner', 'Translator' :
# Create your views here. # Create your views here.
def BookView(request,book_identifier): def BookView(request,book_identifier):
book=get_object_or_404(Book,isbn=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 shelves = None
global relations global relations
if book.category: if book.category:
@ -38,7 +38,7 @@ def BookRedirect(request,book_identifier):
def PersonView(request,person_identifier): def PersonView(request,person_identifier):
global relations global relations
person = get_object_or_404(Person,id=person_identifier) 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 = {} contributed = {}
for book in books: for book in books:
if str(book.relation) in relations: if str(book.relation) in relations: