X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=m_librarian%2Fdb.py;h=e7eea99560eadf289c8beab669c0043fa3cfdaa7;hb=8d0cd0faf04cf7a988b77d6fe2a4285444a2f3ea;hp=8786a461b8c69e4dd6fcfd032abce9054e5d7ddc;hpb=e40cd86d810518b13b511fee568a02539ed6b46c;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)