X-Git-Url: https://git.phdru.name/?p=m_librarian.git;a=blobdiff_plain;f=m_librarian%2Fweb%2Fapp.py;h=5d9285e2254912b1f01404d9afaa4cebb41f6489;hp=42c5c5a632bee899df2105b1be5c214cd453557c;hb=ecd2349c26418c8b55ec9e0d17009321b6472236;hpb=18f8a04ae9135d026a4db5548f80b00e40b763e0 diff --git a/m_librarian/web/app.py b/m_librarian/web/app.py index 42c5c5a..5d9285e 100644 --- a/m_librarian/web/app.py +++ b/m_librarian/web/app.py @@ -59,11 +59,13 @@ def search_authors_post(): )] authors = search_authors(search_type, case_sensitive, {}, expressions, orderBy=('surname', 'name', 'misc_name')) + columns = get_config().getlist('columns', 'author', ['fullname']) return { 'authors': list(authors), 'search_authors': value, 'search_type': search_type, 'case_sensitive': case_sensitive, + 'columns': columns, } @@ -71,6 +73,7 @@ def search_authors_post(): @cheetah_view('books_by_author.tmpl') def books_by_author(id): use_filters = get_config().getint('filters', 'use_in_books_list', 1) + columns = get_config().getlist('columns', 'book', ['title']) if use_filters: join_expressions = [] join_expressions.append(Book.j.authors) @@ -81,6 +84,7 @@ def books_by_author(id): return { 'author': Author.get(id), 'books': books, + 'columns': columns, } else: return { @@ -88,7 +92,8 @@ def books_by_author(id): 'books': Book.select( Book.j.authors & (Author.q.id == id), orderBy=['series', 'ser_no', 'title'], - ) + ), + 'columns': columns, } @@ -157,9 +162,11 @@ def search_books_post(): else: books_by_author = books_by_authors[author] = [] books_by_author.append(book) + columns = get_config().getlist('columns', 'book', ['title']) return { 'books_by_author': books_by_authors, 'search_books': value, 'search_type': search_type, 'case_sensitive': case_sensitive, + 'columns': columns, }