TODO-28 - completed and used to reduce unwanted cols for on wish list, and add rating for poor rating books
This commit is contained in:
11
main.py
11
main.py
@@ -36,7 +36,7 @@ from genre import Genre, GenreForm, GenreSchema, GetGenres
|
||||
from condition import Condition, ConditionForm, ConditionSchema, GetConditionById
|
||||
from covertype import Covertype, CovertypeForm, CovertypeSchema, GetCovertypeById
|
||||
from owned import Owned, OwnedForm, OwnedSchema, GetOwnedById
|
||||
from rating import Rating, RatingForm, RatingSchema
|
||||
from rating import Rating, RatingForm, RatingSchema, GetRatingById
|
||||
from loan import Loan, LoanForm, LoanSchema
|
||||
from series import Series, SeriesForm, SeriesSchema, ListOfSeriesWithMissingBooks
|
||||
|
||||
@@ -237,6 +237,7 @@ app.jinja_env.globals['GetCovertypeById'] = GetCovertypeById
|
||||
app.jinja_env.globals['GetOwnedById'] = GetOwnedById
|
||||
app.jinja_env.globals['GetConditionById'] = GetConditionById
|
||||
app.jinja_env.globals['GetPublisherById'] = GetPublisherById
|
||||
app.jinja_env.globals['GetRatingById'] = GetRatingById
|
||||
app.jinja_env.globals['SeriesBookNum'] = SeriesBookNum
|
||||
app.jinja_env.globals['ClearStatus'] = st.ClearMessage
|
||||
app.jinja_env.globals['ListOfSeriesWithMissingBooks'] = ListOfSeriesWithMissingBooks
|
||||
@@ -673,22 +674,22 @@ def missing_books():
|
||||
@app.route("/wishlist", methods=["GET"])
|
||||
def wishlist():
|
||||
books = Book.query.join(Owned).filter(Owned.name=='On Wish List').all()
|
||||
return render_template("books.html", books=books )
|
||||
return render_template("books.html", books=books, page_title="Books On Wish List", show_cols='', hide_cols='Publisher,Condition,Covertype' )
|
||||
|
||||
@app.route("/needs_replacing", methods=["GET"])
|
||||
def needs_replacing():
|
||||
books = Book.query.join(Condition,Owned).filter(Condition.name=='Needs Replacing',Owned.name=='Currently Owned').all()
|
||||
return render_template("books.html", books=books )
|
||||
return render_template("books.html", books=books, page_title="Books that Need Replacing", show_cols='', hide_cols='' )
|
||||
|
||||
@app.route("/sold", methods=["GET"])
|
||||
def sold_books():
|
||||
books = Book.query.join(Owned).filter(Owned.name=='Sold').all()
|
||||
return render_template("books.html", books=books )
|
||||
return render_template("books.html", books=books, page_title="Books that were Sold", show_cols='', hide_cols='' )
|
||||
|
||||
@app.route("/poor_rating", methods=["GET"])
|
||||
def poor_rating_books():
|
||||
books = Book.query.join(Rating,Owned).filter(Rating.id>6,Rating.name!='Undefined',Owned.name=='Currently Owned').all()
|
||||
return render_template("books.html", books=books )
|
||||
return render_template("books.html", books=books, page_title="Books that have a Poor Rating (<5 out of 10)", show_cols='Rating', hide_cols='' )
|
||||
|
||||
|
||||
@app.route("/", methods=["GET"])
|
||||
|
||||
Reference in New Issue
Block a user