-@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', 1)
- columns = get_config().getlist('columns', 'book', ['title'])
- if use_filters:
- join_expressions = []
- join_expressions.append(Book.j.authors)
- join_expressions.append(Author.q.id == id)
- books = search_books('full', None, {}, join_expressions,
- orderBy=('series', 'ser_no', 'title', '-date'),
- use_filters=use_filters)
- return {
- 'author': Author.get(id),
- 'books': books,
- 'columns': columns,
- }
- else:
- return {
- 'author': Author.get(id),
- 'books': Book.select(
- Book.j.authors & (Author.q.id == id),
- orderBy=['series', 'ser_no', 'title'],
- ),
- 'columns': columns,
- }
+@route('/books-by-author/<aid:int>/', method='GET')
+@cheetah_view('list_books.tmpl')
+def _books_by_author(aid):
+ return books_by_author(aid)