Exemplo n.º 1
0
def activate_book(book_id):
    book = Book.get_by_id(book_id)
    if book is None:
        return "Book not found"
    else:
        book.update("active", True)
        return "Active"
Exemplo n.º 2
0
def update_description(book_id):
    book = Book.get_by_id(book_id)
    if book is None:
        return "Book not found"
    else:
        description = request.form['description-2']
        book.description = description
        book.update("description", description)
        return "Updated"