示例#1
0
 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))
示例#2
0
 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))
示例#3
0
    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))