new sqlaclhemy needs separated .join()s
This commit is contained in:
6
main.py
6
main.py
@@ -966,7 +966,7 @@ def books_on_shelf():
|
|||||||
@app.route("/unrated_books", methods=["GET"])
|
@app.route("/unrated_books", methods=["GET"])
|
||||||
@login_required
|
@login_required
|
||||||
def unrated_books():
|
def unrated_books():
|
||||||
books = Book.query.join(Rating,Owned).filter(Rating.name=='Undefined',Owned.name=='Currently Owned').all()
|
books = Book.query.join(Rating).join(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='' )
|
return render_template("books.html", books=books, page_title="Books with no rating", show_cols='Rating', hide_cols='' )
|
||||||
|
|
||||||
def FindMissingBooks():
|
def FindMissingBooks():
|
||||||
@@ -1017,7 +1017,7 @@ def books_to_buy():
|
|||||||
@app.route("/needs_replacing", methods=["GET"])
|
@app.route("/needs_replacing", methods=["GET"])
|
||||||
@login_required
|
@login_required
|
||||||
def needs_replacing():
|
def needs_replacing():
|
||||||
books = Book.query.join(Condition,Owned).filter(Condition.name=='Needs Replacing',Owned.name=='Currently Owned').all()
|
books = Book.query.join(Condition).join(Owned).filter(Condition.name=='Needs Replacing',Owned.name=='Currently Owned').all()
|
||||||
return render_template("books.html", books=books, page_title="Books that Need Replacing", show_cols='', hide_cols='' )
|
return render_template("books.html", books=books, page_title="Books that Need Replacing", show_cols='', hide_cols='' )
|
||||||
|
|
||||||
@app.route("/sold", methods=["GET"])
|
@app.route("/sold", methods=["GET"])
|
||||||
@@ -1029,7 +1029,7 @@ def sold_books():
|
|||||||
@app.route("/poor_rating", methods=["GET"])
|
@app.route("/poor_rating", methods=["GET"])
|
||||||
@login_required
|
@login_required
|
||||||
def poor_rating_books():
|
def poor_rating_books():
|
||||||
books = Book.query.join(Rating,Owned).filter(Rating.id>6,Rating.name!='Undefined',Owned.name=='Currently Owned').all()
|
books = Book.query.join(Rating).join(Owned).filter(Rating.id>6,Rating.name!='Undefined',Owned.name=='Currently Owned').all()
|
||||||
return render_template("books.html", books=books, page_title="Books that have a Poor Rating (<5 out of 10)", show_cols='Rating', hide_cols='' )
|
return render_template("books.html", books=books, page_title="Books that have a Poor Rating (<5 out of 10)", show_cols='Rating', hide_cols='' )
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user