Ejemplo n.º 1
0
def delete_book(book):
    """ Removes book from store. Raises BookError if book not in store. 
    :param book the Book to delete """

    rows_deleted = Book.delete().where(Book.id == book.id).execute()
    if not rows_deleted:
        raise BookError('Tried to delete book that doesn\'t exist')
Ejemplo n.º 2
0
def delete_all_books():
    """ Deletes all books from database """
    Book.delete().execute()
Ejemplo n.º 3
0
def delete_all_books():
    """ Clears the book list """
    Book.delete().execute()