def view_entries(search_query=None):
query = Entry.select().order_by(Entry.timestamp.desc())<EOL>if search_query:<EOL><INDENT>query = query.where(Entry.content.contains(search_query))<EOL><DEDENT>for entry in query:<EOL><INDENT>timestamp = entry.timestamp.strftime('<STR_LIT>')<EOL>print(timestamp)<EOL>print('<STR_LIT:=>' * len(timestamp))<EOL>print(entry.content)<EOL>print('<STR_LIT>')<EOL>print('<STR_LIT>')<EOL>print('<STR_LIT>')<EOL>action = raw_input('<STR_LIT>').lower().strip()<EOL>if action == '<STR_LIT:q>':<EOL><INDENT>break<EOL><DEDENT>elif action == '<STR_LIT:d>':<EOL><INDENT>entry.delete_instance()<EOL>break<EOL><DEDENT><DEDENT>
View previous entries