|
|
@ -65,6 +65,7 @@ def show_book_by_id(id):
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
return render_template('show_book_detail.html', book=book)
|
|
|
|
return render_template('show_book_detail.html', book=book)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/books/<int:id>/delete', methods=['POST', 'GET'])
|
|
|
|
@app.route('/books/<int:id>/delete', methods=['POST', 'GET'])
|
|
|
|
def remove_book_by_id(id):
|
|
|
|
def remove_book_by_id(id):
|
|
|
|
book_to_edit = Book.query.filter_by(id=id).first()
|
|
|
|
book_to_edit = Book.query.filter_by(id=id).first()
|
|
|
@ -162,6 +163,8 @@ def flash_errors(form):
|
|
|
|
error
|
|
|
|
error
|
|
|
|
))
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Authors
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/authors/<int:id>')
|
|
|
|
@app.route('/authors/<int:id>')
|
|
|
|
def show_author_by_id(id):
|
|
|
|
def show_author_by_id(id):
|
|
|
|
author = Author.query.get(id)
|
|
|
|
author = Author.query.get(id)
|
|
|
@ -170,6 +173,15 @@ def show_author_by_id(id):
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
return render_template('show_author_detail.html', author=author)
|
|
|
|
return render_template('show_author_detail.html', author=author)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/authors/<int:id>/edit', methods=['POST', 'GET'])
|
|
|
|
|
|
|
|
def edit_author_by_id(id):
|
|
|
|
|
|
|
|
#EDIT AUTHOR TO DO
|
|
|
|
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
###
|
|
|
|
###
|
|
|
|
# The API
|
|
|
|
# The API
|
|
|
|
###
|
|
|
|
###
|
|
|
|