X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=m_librarian%2Fdb.py;h=e7eea99560eadf289c8beab669c0043fa3cfdaa7;hb=868f9fd045fa1b4aecc328f818017ecbc91533c4;hp=8786a461b8c69e4dd6fcfd032abce9054e5d7ddc;hpb=b0c1d9a111696fd1f4b8d6d79e472047d53c8957;p=m_librarian.git diff --git a/m_librarian/db.py b/m_librarian/db.py index 8786a46..e7eea99 100755 --- a/m_librarian/db.py +++ b/m_librarian/db.py @@ -20,6 +20,12 @@ class Author(SQLObject): 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)