(self)
return group_block
Returns a dict with the block data.

        Raises:
            ValueError: if the block has not been fed with data.
            TypeError: if the data that was fed is of the wrong type.

        Returns:
            A dict with the block data.
Returns a dict with the block data.
Returns a dict with the block data .
def to_dict(self):
        """Returns a dict with the block data.

        Raises:
            ValueError: if the block has not been fed with data.
            TypeError: if the data that was fed is of the wrong type.

        Returns:
            A dict with the block data.
        """
        if not self._data:
            raise ValueError('No data has been fed to the block.')

        group_obj = self._data
        if not hasattr(group_obj, 'id'):
            raise TypeError('Aggregation group object is not correctly formed.')

        if not hasattr(group_obj, 'aggregations'):
            raise TypeError('Aggregation group object is not correctly formed.')

        group_block = self._get_base()
        group_block['componentName'] = 'TsAggregationGroupCompact'
        group_block['componentProps']['aggregation_group'] = {
            'id': group_obj.id,
            'name': group_obj.name,
        }

        return group_block
def to_dict ( self ) : if not self . _data : raise ValueError ( 'No data has been fed to the block.' ) group_obj = self . _data if not hasattr ( group_obj , 'id' ) : raise TypeError ( 'Aggregation group object is not correctly formed.' ) if not hasattr ( group_obj , 'aggregations' ) : raise TypeError ( 'Aggregation group object is not correctly formed.' ) group_block = self . _get_base ( ) group_block [ 'componentName' ] = 'TsAggregationGroupCompact' group_block [ 'componentProps' ] [ 'aggregation_group' ] = { 'id' : group_obj . id , 'name' : group_obj . name , } return group_block