diff --git a/python/search.py b/python/search.py index f5a5c1f..46b6b12 100644 --- a/python/search.py +++ b/python/search.py @@ -6,13 +6,14 @@ from util import * def search_book_cmd(search_strings, search_description=False): books = search_book(search_strings, search_description) - format = '%13s %10s %-40s %15s' + format = '%-13s %-10s %-40s %-30s' for book in books: b_id = book.getid() or '' title = cut_str(book.title, 40) - # TODO author - author = '' - print format % (book.isbn, b_id, title, author) + authors = map(lambda p: p.first_name+' '+p.last_name, + book.get_authors()) + authors_str = cut_str(', '.join(authors), 30) + print format % (book.isbn, b_id, title, authors_str) def search_book(search_strings, search_description=False): basic_query = Book.objects