示例#1
0
    def sort_group(self, field, order):
        """
        Sorts Tuple elements within a group on the specified field in the specified Order.

        Note: Only groups of Tuple elements can be sorted.
        Groups can be sorted by multiple fields by chaining sort_group() calls.

        :param field:The Tuple field on which the group is sorted.
        :param order: The Order in which the specified Tuple field is sorted. See DataSet.Order.
        :return:A SortedGrouping with specified order of group element.
        """
        child = OperationInfo()
        child_set = SortedGrouping(self._env, child, self._child_chain)
        child.identifier = _Identifier.SORT
        child.parent = self._info
        child.field = field
        child.order = order
        self._info.children.append(child)
        self._child_chain.append(child)
        self._env._sets.append(child)
        return child_set
示例#2
0
    def sort_group(self, field, order):
        """
        Sorts Tuple elements within a group on the specified field in the specified Order.

        Note: Only groups of Tuple elements can be sorted.
        Groups can be sorted by multiple fields by chaining sort_group() calls.

        :param field:The Tuple field on which the group is sorted.
        :param order: The Order in which the specified Tuple field is sorted. See DataSet.Order.
        :return:A SortedGrouping with specified order of group element.
        """
        child = OperationInfo()
        child_set = SortedGrouping(self._env, child, self._child_chain)
        child.identifier = _Identifier.SORT
        child.parent = self._info
        child.field = field
        child.order = order
        self._info.children.append(child)
        self._child_chain.append(child)
        self._env._sets.append(child)
        return child_set