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:
28
main.py
28
main.py
@@ -338,21 +338,31 @@ def book(id):
|
||||
message="Sorry, Deleting unsupported at present"
|
||||
else:
|
||||
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()
|
||||
message="Successfully Updated Book (id={})".format(id)
|
||||
else:
|
||||
book_form=BookForm(request.form)
|
||||
# set defaults for drop-down's based on this book
|
||||
book_form.condition.default = book.condition
|
||||
book_form.covertype.default = book.covertype
|
||||
book_form.owned.default = book.owned
|
||||
book_form.rating.default = book.rating
|
||||
book_form.process()
|
||||
|
||||
book_s = book_schema.dump(book)
|
||||
|
||||
book_form=BookForm(request.form)
|
||||
# set defaults for drop-down's based on this book
|
||||
book_form.condition.default = book.condition
|
||||
book_form.covertype.default = book.covertype
|
||||
book_form.owned.default = book.owned
|
||||
book_form.rating.default = book.rating
|
||||
book_form.process()
|
||||
author_list = GetAuthors()
|
||||
genre_list = GetGenres()
|
||||
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 )
|
||||
|
||||
@app.route("/", methods=["GET"])
|
||||
|
||||
Reference in New Issue
Block a user