books = RelatedJoin('Book', otherColumn='book_id',
intermediateTable='author_book',
createRelatedTable=False)
+
+ @property
+ def fullname(self):
+ fullnames = filter(None, (self.surname, self.name, self.misc_name))
+ return ' '.join(fullnames)
+
full_name_idx = DatabaseIndex(surname, name, misc_name, unique=True)
count_idx = DatabaseIndex(count)
return
count = 0
for author in authors:
- names = filter(None, (author.surname, author.name, author.misc_name))
- fullname = u' '.join(names)
- print fullname.encode(default_encoding), \
+ print author.fullname.encode(default_encoding), \
(u"(%s: %d)" % (_('books'), author.count))\
.encode(default_encoding),
if args.verbose >= 1:
if args.verbose >= 1:
print " ", _("Author(s)").encode(default_encoding), ":",
for author in book.authors:
- names = filter(None,
- (author.surname, author.name, author.misc_name))
- fullname = u' '.join(names)
- print fullname.encode(default_encoding),
+ print author.fullname.encode(default_encoding),
print
print " ", _("Genre(s)").encode(default_encoding), ":",
for genre in book.genres: