fixed BUG-12: remove loaned out books from results of search for books to add to a loan
This commit is contained in:
8
BUGs
8
BUGs
@@ -1,11 +1,15 @@
|
|||||||
#### BUGS (next-13)
|
#### BUGS (next-13)
|
||||||
|
|
||||||
|
### DB/back-end
|
||||||
BUG-2: series does not deal with calcd_rating...
|
BUG-2: series does not deal with calcd_rating...
|
||||||
- (on edit could, recalc as a catch-all, and obviously if we change a single book's rating, we should re-calc)
|
- (on edit could, recalc as a catch-all, and obviously if we change a single book's rating, we should re-calc)
|
||||||
|
BUG-13: deleting loan fails with book_loan_link data still existing
|
||||||
|
|
||||||
|
### UI not updating after DB change:
|
||||||
BUG-3: alter a condition, covertype, etc. and its not in drop-down list (even though db look via index is correct, e.g books.html shows updated covertype)
|
BUG-3: alter a condition, covertype, etc. and its not in drop-down list (even though db look via index is correct, e.g books.html shows updated covertype)
|
||||||
|
BUG-7: if you remove a series from a book, it won't appear in the series drop-down if it is the first 'missing' book in that series -- either reset the list, or show all series always?
|
||||||
|
|
||||||
|
### ordering of data in UI:
|
||||||
BUG-6: author,series, etc. do not have explicit ordering like sub-books... sort of irritating / needs code and DB fix
|
BUG-6: author,series, etc. do not have explicit ordering like sub-books... sort of irritating / needs code and DB fix
|
||||||
- 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)
|
- 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)
|
||||||
|
|
||||||
BUG-7: if you remove a series from a book, it won't appear in the series drop-down if it is the first 'missing' book in that series -- either reset the list, or show all series always?
|
|
||||||
BUG-12: remove loaned out books from results of search for books to add to a loan
|
|
||||||
|
|||||||
1
README
1
README
@@ -55,4 +55,3 @@ TODO-19: icons on wish list, etc.? (not sure I really want them, but if so)
|
|||||||
TODO-20: ORM all books load is slow
|
TODO-20: ORM all books load is slow
|
||||||
- should I lazy load all books (ajax the 2nd->last pages in, or not use ORM, and do a quick db.execute()....)
|
- should I lazy load all books (ajax the 2nd->last pages in, or not use ORM, and do a quick db.execute()....)
|
||||||
TODO-21: allow a way to add a book as a child of another existing book (opposite of rem_sub_book)
|
TODO-21: allow a way to add a book as a child of another existing book (opposite of rem_sub_book)
|
||||||
|
|
||||||
|
|||||||
6
main.py
6
main.py
@@ -230,12 +230,14 @@ book_schema = BookSchema()
|
|||||||
####################################### ROUTES #######################################
|
####################################### ROUTES #######################################
|
||||||
@app.route("/search", methods=["POST"])
|
@app.route("/search", methods=["POST"])
|
||||||
def search():
|
def search():
|
||||||
books = Book.query.filter(Book.title.ilike("%{}%".format(request.form['term']))).all()
|
|
||||||
AddSubs(books)
|
|
||||||
if 'InDBox' in request.form:
|
if 'InDBox' in request.form:
|
||||||
|
# removes already loaned books from list of books to loan out
|
||||||
|
books = Book.query.outerjoin(Book_Loan_Link).filter(Book.title.ilike("%{}%".format(request.form['term'])),Book_Loan_Link.loan_id==None).all()
|
||||||
InDBox=1
|
InDBox=1
|
||||||
else:
|
else:
|
||||||
|
books = Book.query.filter(Book.title.ilike("%{}%".format(request.form['term']))).all()
|
||||||
InDBox=0
|
InDBox=0
|
||||||
|
AddSubs(books)
|
||||||
return render_template("books.html", books=books, InDBox=InDBox)
|
return render_template("books.html", books=books, InDBox=InDBox)
|
||||||
|
|
||||||
@app.route("/books", methods=["GET"])
|
@app.route("/books", methods=["GET"])
|
||||||
|
|||||||
Reference in New Issue
Block a user