Last active
December 18, 2015 01:39
-
-
Save timtan/5705233 to your computer and use it in GitHub Desktop.
the skeleton of you AnnNote
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class NoteBookDB(object): | |
| def __init__(self): | |
| pass | |
| def create_db(self): | |
| "Create Database here" | |
| pass | |
| def is_db_exists(self): | |
| return False | |
| # Create | |
| def add_book(self, title, content): | |
| "please return the newly created id_" | |
| pass | |
| # Retrieve | |
| def get_book(self, id_): | |
| return None | |
| # Search | |
| def find_books(self, word): | |
| return [] | |
| # Update | |
| def update_book(self, id_, title, content): | |
| pass | |
| # List | |
| def list_books(self): | |
| return [] | |
| def delete_book(self, id_ ): | |
| pass | |
| if __name__ == '__main__': | |
| notebookDB = NoteBookDB() | |
| if not notebookDB.is_db_exists(): | |
| notebookDB.create_db() | |
| notebookDB.add_book('chapter one of english', 'blah blah') | |
| if not notebookDB.find_books('english'): | |
| print 'Strange, you should find out the book' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment