def delete_book(): book_id = ui.ask_question('Enter the book ID: ') book = store.get_book_by_id(book_id) try: store.delete_book(book) except: print("Error: Book Not Found")
def search_book(): # while true: search_term = ui.ask_question( 'Enter search term, will match partial authors or titles.') # if(not search_term): # print("You cannot enter in a blank string") # else: # break matches = store.book_search(search_term) ui.show_books(matches)
def search_book(): search_term = ui.ask_question( 'Enter search term, will match partial authors or titles.') if search_term == None: print('Nothing was entered try again') else: matches = store.book_search(search_term) ui.show_books(matches)
def delete_book(): try: book_id = ui.get_book_id() book = store.get_book_by_id(book_id) answer = ui.ask_question("Type DELETE to confirm you'd like to delete this book: ") if answer == "DELETE": Book.delete(book) else: ui.message("Returning to main menu. Book has not been deleted.") except: ui.message('Error - book not found with that ID')
def ask_question(self, mock_print, mock_input): self.assertEqual('pizza', ui.ask_question('What is your favorite food?')) mock_print.assert_called_with('What is your favorite food?')
def search_book(): search_term = ui.ask_question( 'Enter search term, will match partial authors or titles.') matches = store.book_search(search_term) ui.show_books(matches)
def search_for_an_artist(): search_term = ui.ask_question('Enter search term, will match partial names or emails.') matches = store.artist_search(search_term) ui.show_artists(matches)
def delete_book(): search_term = ui.ask_question('Enter book ID: ' ) matches = store.book_search(search_term) ui.show_books(matches) # Corrected "show_book" to "show_books"
def delete_artwork(): art_to_delete = ui.ask_question('Enter name of Artwork to delete: ') db.delete_artwork(art_to_delete)
def show_available_art_by_artist(): search_term = ui.ask_question( 'Enter name of Artist to view their available works: ') available_art = db.get_available_art_by_artist(search_term) ui.show_artwork(available_art)
def show_all_art_by_artist(): search_term = ui.ask_question('Enter name of Artist to view their works: ') matches = db.artist_art_search(search_term) ui.show_artwork(matches)
def search_book(): """ searches book in the database then displays it""" search_term = ui.ask_question( 'Enter search term, will match partial authors or titles.') matches = store.book_search(search_term) ui.show_books(matches)
def searh_artwork(): search_artwork = ui.ask_question('Enter artwork name: ') art = store.get_artwork_by_name(search_artwork) ui.show_all_artwork(art)
def search_artwork(): search_term = ui.ask_question('Enter search term, will match partial name or email') matches = artworkstore.search_artwork(search_term) ui.show_artworks(matches)