Fikset litt på Book.to_string.
Det var noe unicode-trøbbel fordi man hadde kalt str istedenfor unicode. Jeg endret dessuten litt på formateringen.
This commit is contained in:
parent
4db8928d01
commit
bd5d6a4ed1
|
@ -57,14 +57,15 @@ class Book(models.Model):
|
|||
for field in book_fields:
|
||||
try:
|
||||
scratch += format % (field[1],eval('self.'+field[0]))
|
||||
except Id.DoesNotExist:
|
||||
scratch += format % (field[1], "None")
|
||||
except AttributeError:
|
||||
scratch += format % (field[1], '')
|
||||
authors = ','.join(map(lambda x: str(x),self.get_authors()))
|
||||
authors = ', '.join(map(unicode, self.get_authors()))
|
||||
scratch += format % ('Authors', authors)
|
||||
# scratch += 'Authors'.ljust(15, ' ') + ':'
|
||||
# scratch += authors.rjust(51, ' ')
|
||||
|
||||
scratch += '\n'
|
||||
return scratch
|
||||
|
||||
def to_dict(self):
|
||||
|
|
Reference in New Issue