예제 #1
0
 def _get_matched_detail_column(self, case_tile_field):
     """
     Get the detail column that should populate the given case tile field
     """
     column = self.cols_by_tile_field.get(case_tile_field, None)
     if column is None:
         raise SuiteError(
             'No column was mapped to the "{}" case tile field'.format(
                 case_tile_field))
     return column
예제 #2
0
    def to_frame(self):
        if not self.children and not self.allow_empty_frame:
            return

        children = _replace_session_references_in_stack(
            self.children, current_session=self.current_session)

        frame = CreateFrame(if_clause=self.if_clause)

        for child in children:
            if isinstance(child, CommandId):
                frame.add_command(child.to_command())
            elif isinstance(child, (StackDatum, StackQuery)):
                frame.add_datum(child)
            else:
                raise SuiteError("Unexpected child type: {} ({})".format(
                    type(child), child))

        return frame
예제 #3
0
 def case_type(self, case_type):
     if self.case_type and case_type != self.case_type:
         raise SuiteError("Datum already has a case type")
     self._case_type = case_type