Ejemplo n.º 1
0
def exact_match(book):
    search = Book.get_or_none((Book.title == book.title)
                              & (Book.author == book.author))
    return search is not None
Ejemplo n.º 2
0
def get_book_by_id(book_id):
    """ Searches list for Book with given ID,
    :param id the ID to search for
    :returns the book, if found, or None if book not found.
    """
    return Book.get_or_none(Book.id == book_id)