update BUGs and README, to show issues with saving book... Many fields now save, but still some bugged or not tried
This commit is contained in:
4
BUGs
4
BUGs
@@ -3,3 +3,7 @@ series does not deal with calcd_rating...
|
|||||||
|
|
||||||
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)
|
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)
|
||||||
|
|
||||||
|
book form is not validating (year published)
|
||||||
|
save book, notes/forms not sticking
|
||||||
|
tried publisher, firstly the <input ...> has id="publisher", but not
|
||||||
|
name="publisher", so request.form does not have field publisher, hand-hacking that and then int/str mismatch... I think need to read up on how to take select 'value' as the int value of the chosen option
|
||||||
|
|||||||
1
README
1
README
@@ -26,6 +26,7 @@ python3 main.py
|
|||||||
|
|
||||||
### TODO:
|
### TODO:
|
||||||
- need to save a book
|
- need to save a book
|
||||||
|
- still missing author, publisher, genre, notes, blurb. not sure about series/loan/subbook, etc.
|
||||||
- need to create all classes (green + button)
|
- need to create all classes (green + button)
|
||||||
- need to delete all classes (and watch for referential integrity)
|
- need to delete all classes (and watch for referential integrity)
|
||||||
- need to delete 1 book from sub_book, series, loan
|
- need to delete 1 book from sub_book, series, loan
|
||||||
|
|||||||
16
main.py
16
main.py
@@ -338,11 +338,18 @@ def book(id):
|
|||||||
message="Sorry, Deleting unsupported at present"
|
message="Sorry, Deleting unsupported at present"
|
||||||
else:
|
else:
|
||||||
book.title = request.form['title']
|
book.title = request.form['title']
|
||||||
|
book.owned = request.form['owned']
|
||||||
|
book.covertype = request.form['covertype']
|
||||||
|
book.condition = request.form['condition']
|
||||||
|
book.year_published = request.form['year_published']
|
||||||
|
book.rating = request.form['rating']
|
||||||
|
book.notes = request.form['notes']
|
||||||
|
book.blurb = request.form['blurb']
|
||||||
|
## TODO:
|
||||||
|
# process author, genre, publisher & series?, subbooks?, loan?, etc.
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
message="Successfully Updated Book (id={})".format(id)
|
message="Successfully Updated Book (id={})".format(id)
|
||||||
|
else:
|
||||||
book_s = book_schema.dump(book)
|
|
||||||
|
|
||||||
book_form=BookForm(request.form)
|
book_form=BookForm(request.form)
|
||||||
# set defaults for drop-down's based on this book
|
# set defaults for drop-down's based on this book
|
||||||
book_form.condition.default = book.condition
|
book_form.condition.default = book.condition
|
||||||
@@ -350,9 +357,12 @@ def book(id):
|
|||||||
book_form.owned.default = book.owned
|
book_form.owned.default = book.owned
|
||||||
book_form.rating.default = book.rating
|
book_form.rating.default = book.rating
|
||||||
book_form.process()
|
book_form.process()
|
||||||
|
|
||||||
author_list = GetAuthors()
|
author_list = GetAuthors()
|
||||||
genre_list = GetGenres()
|
genre_list = GetGenres()
|
||||||
publisher_list = GetPublishers()
|
publisher_list = GetPublishers()
|
||||||
|
|
||||||
|
book_s = book_schema.dump(book)
|
||||||
return render_template("book.html", b=book, books=book_s, book_form=book_form, author_list=author_list, publisher_list=publisher_list, genre_list=genre_list, alert=alert, message=message )
|
return render_template("book.html", b=book, books=book_s, book_form=book_form, author_list=author_list, publisher_list=publisher_list, genre_list=genre_list, alert=alert, message=message )
|
||||||
|
|
||||||
@app.route("/", methods=["GET"])
|
@app.route("/", methods=["GET"])
|
||||||
|
|||||||
Reference in New Issue
Block a user