diff --git a/python/web/library/models.py b/python/web/library/models.py index 8f2857e..8752a4e 100644 --- a/python/web/library/models.py +++ b/python/web/library/models.py @@ -1,6 +1,6 @@ from django.db import models -book_fields = {'isbn' : 'ISBN', 'id' : 'Identifier', 'title' : 'Title', +book_fields = {'isbn' : 'ISBN', 'id.id' : 'Identifier', 'title' : 'Title', 'subtitle' : 'Subtitle', 'category' : 'Category', 'publisher':'Publisher', 'published_year':'Published year', 'edition' : 'Edition', 'num_pages' : 'Number of pages', 'series' : 'Series', 'description' : 'Description'} @@ -42,6 +42,8 @@ class Book(models.Model): print '%-15s: %50s' % (field[1],eval('self.'+field[0])) except Category.DoesNotExist: print '%-15s: %50s' % (field[1], 'Does not exist') + except Id.DoesNotExist: + print '%-15s: %50s' % (field[1], '') def getid(self): try: