From 94ddee77914e81a5eb15364cccebcfb78e85607f Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Fri, 8 Jan 2021 22:43:48 +1100 Subject: [PATCH] completed TODO-11 (unrated books) --- README | 1 - main.py | 5 +++++ templates/base.html | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README b/README index 57f4e65..0a0cf0a 100644 --- a/README +++ b/README @@ -31,7 +31,6 @@ sudo docker-compose -f /srv/docker/config/docker-compose.yml up bookdb_web ########################################################### TODOS (next 27): TODO-09: show books to buy view / printable -TODO-11: show unrated books (with toggle to exclude those with missing in a series) TODO-12: show books missing from a series (I own only some of them) TODO-13: show books on wish list TODO-14: show books that need replacing diff --git a/main.py b/main.py index d0c5b8b..215da45 100644 --- a/main.py +++ b/main.py @@ -649,6 +649,11 @@ def books_on_shelf(): books = db.engine.execute("select * from book where id not in ( select sub_book_id from book_sub_book_link ) and owned = (select id from owned where name = 'Currently Owned')") return render_template("books.html", books=books ) +@app.route("/unrated_books", methods=["GET"]) +def unrated_books(): + books = db.engine.execute("select * from book where rating = (select id from rating where name = 'Undefined') and owned = (select id from owned where name = 'Currently Owned')") + return render_template("books.html", books=books ) + @app.route("/", methods=["GET"]) def main_page(): return render_template("base.html", alert=st.GetAlert(), message=st.GetMessage()) diff --git a/templates/base.html b/templates/base.html index c09e311..210efe4 100644 --- a/templates/base.html +++ b/templates/base.html @@ -48,6 +48,7 @@ Create Show All Show Books on shelf + Show Unrated_Books Show Stats