diff --git a/python/web/library/models.py b/python/web/library/models.py index 6386bbf..7b22baa 100644 --- a/python/web/library/models.py +++ b/python/web/library/models.py @@ -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):