def Book_lookup(): form = BookDetails() if request.method == 'POST' and form.validate_on_submit(): # print(form.data) return render_template('/book_form.html', form=form) else: return render_template('/book_form.html', form=form)
def Book_edit(book_id): form = None if request.method == 'POST' and form.validate_on_submit(): form = BookDetails() if book_id is not None: book_details = Book().retrieve(book_id) form.populate_form(book_details) # response = Book.add() elif book_id is None: # response = Book.update() pass return render_template('book_details.html', form=form)