示例#1
0
    def rows(self):
        risk_profile = self.risk_profile
        result = []
        message_bank_messages = get_message_bank(self.domain,
                                                 for_comparing=True)
        data = {}
        for case in self.interactive_participants:
            data[case._id] = self.get_participant_message_counts(
                message_bank_messages, case)

        for entry in message_bank_messages:
            msg_risk_profile = entry["message"].risk_profile
            if risk_profile and risk_profile != msg_risk_profile:
                continue
            msg_risk_profile_desc = None
            if msg_risk_profile:
                msg_risk_profile_desc = PROFILE_DESC.get(msg_risk_profile)
            msg_risk_profile_desc = msg_risk_profile_desc or "-"
            row = [
                self._fmt(entry["message"].message),
                self._fmt2(entry["message"].fri_id, msg_risk_profile_desc),
            ]
            for case in self.interactive_participants:
                row.append(self._fmt(data[case._id][entry["message"]._id]))
            result.append(row)
        return result
示例#2
0
    def rows(self):
        risk_profile = self.risk_profile
        result = []
        message_bank_messages = get_message_bank(self.domain, for_comparing=True)
        data = {}
        for case in self.interactive_participants:
            data[case._id] = self.get_participant_message_counts(message_bank_messages, case)

        for entry in message_bank_messages:
            msg_risk_profile = entry["message"].risk_profile
            if risk_profile and risk_profile != msg_risk_profile:
                continue
            msg_risk_profile_desc = None
            if msg_risk_profile:
                msg_risk_profile_desc = PROFILE_DESC.get(msg_risk_profile)
            msg_risk_profile_desc = msg_risk_profile_desc or "-"
            row = [
                self._fmt(entry["message"].message),
                self._fmt2(entry["message"].fri_id, msg_risk_profile_desc),
            ]
            for case in self.interactive_participants:
                row.append(self._fmt(data[case._id][entry["message"]._id]))
            result.append(row)
        return result