def delete_answer(self, input_data): try: id = int(input_data) except ValueError: print("ERROR: Id should be positive integer.") return view.answer("delete", self.db.delete_answer(id))
def post_answer(self, input_data): try: id = int(input_data) except ValueError: print("ERROR: Id should be positive integer.") return answer = DataBaseHandler.create_answer() view.answer("add", self.db.add_new_answer(answer["email"], answer["text"], id))
def update_answer(self, input_data): try: id = int(input_data) except ValueError: print("ERROR: Id should be positive integer.") return answer = input("Enter new text: ") view.answer("update", self.db.update_question(id, answer))