From bb78bdc67ee559bd77f7e06e95902930c5410471 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 17 Dec 2022 19:15:56 +0300 Subject: [PATCH] Style(app): Rename `id` [skip ci] --- m_librarian/web/app.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/m_librarian/web/app.py b/m_librarian/web/app.py index 8975d7e..31289b8 100644 --- a/m_librarian/web/app.py +++ b/m_librarian/web/app.py @@ -69,22 +69,22 @@ def search_authors_post(): } -@route('/books-by-author//', method='GET') +@route('/books-by-author//', method='GET') @cheetah_view('list_books.tmpl') -def books_by_author(id): +def books_by_author(aid): use_filters = get_config().getint('filters', 'use_in_books_list', 1) columns = get_config().getlist('columns', 'book', ['title']) - author = Author.get(id) + author = Author.get(aid) if use_filters: join_expressions = [] join_expressions.append(Book.j.authors) - join_expressions.append(Author.q.id == id) + join_expressions.append(Author.q.id == aid) books = search_books('full', None, {}, join_expressions, orderBy=('series', 'ser_no', 'title', '-date'), use_filters=use_filters) else: books = Book.select( - Book.j.authors & (Author.q.id == id), + Book.j.authors & (Author.q.id == aid), orderBy=['series', 'ser_no', 'title'], ) @@ -111,12 +111,12 @@ def download_books(): form = request.forms for k in form: if k.split('_')[-1] == 'books': - for _id in form.getall(k): - books_ids.append(_id) + for bid in form.getall(k): + books_ids.append(bid) download_path = get_config().getpath('download', 'path') if books_ids: - for id in books_ids: - book = Book.get(int(id)) + for bid in books_ids: + book = Book.get(int(bid)) download(book, download_path) return { 'message': u'Книги сохранены.', -- 2.39.2