)]
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,
}
@route('/books-by-author/<id:int>/', method='GET')
@cheetah_view('books_by_author.tmpl')
def books_by_author(id):
- use_filters = get_config().getint('filters', 'use_in_books_list')
+ 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)
return {
'author': Author.get(id),
'books': books,
+ 'columns': columns,
}
else:
return {
'books': Book.select(
Book.j.authors & (Author.q.id == id),
orderBy=['series', 'ser_no', 'title'],
- )
+ ),
+ 'columns': columns,
}
@cheetah_view('download.tmpl')
def download_books():
books_ids = request.forms.getall('books')
- download_path = get_config().get('download', 'path')
+ download_path = get_config().getpath('download', 'path')
if books_ids:
for id in books_ids:
book = Book.get(int(id))
orderBy=('title',), use_filters=use_filters)
books_by_authors = {}
for book in books:
- author = book.authors[0].fullname
+ author = book.author1
if author in books_by_authors:
books_by_author = books_by_authors[author]
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,
}