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')
def delete_all_books(): """ Deletes all books from database """ Book.delete().execute()
def delete_all_books(): """ Clears the book list """ Book.delete().execute()