Har forhåpentligvis fikset problemer med forløkke.

This commit is contained in:
2011-03-06 17:51:16 +00:00
parent b85ad52ed4
commit acb9bd6501
3 changed files with 6 additions and 7 deletions

View File

@@ -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()
people = book.persons.all().order_by('person')
shelves = None
global relations
if book.category:
@@ -18,7 +18,6 @@ def BookView(request,book_identifier):
shelves = book.category.placement.all()
contributors = {}
for person in people:
print person.relation
if str(person.relation) in relations:
relation = relations[str(person.relation)]
else:
@@ -39,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()
books = person.books.all().order_by('book')
contributed = {}
for book in books:
if str(book.relation) in relations: