def getMessageById(self, mid):
     dao = MessageDAO()
     result = dao.getMessageById(mid)
     if result == None:
         return jsonify(Error="NOT FOUND"), 404
     else:
         mapped_result = []
         for r in result:
             mapped_result.append(self.mapToDict(r))
         return jsonify(Messages=mapped_result)
 def insertReplyMessage(self, form):
     print('Estoy en el reply handler')
     dao = MessageDAO()
     Or_msg_ID = form['Or_msg_ID']
     print('original message id: ' + Or_msg_ID)
     Or_msg = dao.getMessageById(Or_msg_ID)[0][1]
     print('Original Message : ' + Or_msg)
     Message = form['Message'] + '\n' + 'Re:\' ' + Or_msg + ' \''
     print('Message : ', Message)
     UID = form['UID']
     GID = form['GID']
     r_msg_id = self.insertReplyMessageinChatGroup(UID, GID, Message)
     dao.insertReplyMessage(Or_msg_ID, r_msg_id)
     result = dao.getMessageById(r_msg_id)
     if result == None:
         return jsonify(Error="NOT FOUND"), 404
     else:
         mapped_result = []
         for r in result:
             mapped_result.append(self.mapToDict(r))
         return jsonify(Messages=mapped_result)