def getAllReactions(self): dao = ReactionDAO() result = dao.getAllReactions() mapped_result = [] for r in result: mapped_result.append(self.mapToDict(r)) return jsonify(Reactions=mapped_result)
def getAllReactions(self): dao = ReactionDAO() dao1 = MessageDAO() dao2 = UserDAO() result = dao.getAllReactions() mapped_result = [] for r in result: r[0] = dao1.getMessageById(r[0])[1] r[1] = dao2.getUserById(r[1])[1] + ' ' + dao2.getUserById(r[1])[2] mapped_result.append(self.mapToDict(r)) return jsonify(Reactions=mapped_result)
def getAllReactions(self): dao = ReactionDAO() dao1 = MessageDAO() dao2 = UsersDAO() result = dao.getAllReactions() mapped_result = [] for r in result: mapped_info = [] user = dao2.getUserById(r[0]) message = dao1.getMessageById(r[1]) mapped_info.append(message[1]) # message text in which it reacted mapped_info.append(user[1] + ' ' + user[2]) mapped_info.append(r[2]) mapped_result.append(self.mapToDict(mapped_info)) return jsonify(Reactions=mapped_result)