From e6ce55866583537d459c9bce4d75d7074877d87b Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Wed, 6 Jul 2022 22:38:09 +1000 Subject: [PATCH] fix BUG-19 - unrated books, used wrong table joins --- BUGs | 1 - main.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/BUGs b/BUGs index bb7dab9..7666ec3 100644 --- a/BUGs +++ b/BUGs @@ -13,4 +13,3 @@ BUG-6: author,series, etc. do not have explicit ordering like sub-books... sort - add/remove authors, and after save they are ordered by author.id, not order of addition (prob. needs book_author_link to have an auth_num) #### SHOWSTOPPER: -BUG-19: show unrated gets all books, looks like ORM is not joining as I expected -- I wonder if it relates to that SAWarning about book id being written in the wrong spot? diff --git a/main.py b/main.py index 621e95c..7e9f908 100644 --- a/main.py +++ b/main.py @@ -774,7 +774,7 @@ def books_on_shelf(): @app.route("/unrated_books", methods=["GET"]) @login_required def unrated_books(): - books = Book.query.join(Condition,Owned).filter(Rating.name=='Undefined',Owned.name=='Currently Owned').all() + books = Book.query.join(Rating,Owned).filter(Rating.name=='Undefined',Owned.name=='Currently Owned').all() return render_template("books.html", books=books, page_title="Books with no rating", show_cols='Rating', hide_cols='' ) def FindMissingBooks():