cubes_lite/model/dimension.py
def load(cls, model_data):
        """Create a dimension from a `model` dictionary.  Some rules:

        * ``levels`` might contain level names as strings - names of levels to
          inherit from the template
        """

        model_data = cls.expand_model(model_data)

        name = model_data.get('name')
        ref = model_data.get('ref')
        info = model_data.get('info', {})
        is_plain = model_data.get('is_plain')
        default_level_name = model_data.get('default_level', 'default')

        levels = cls.level_cls.load_list(model_data['levels'])

        dimension = cls(
            name=name,
            ref=ref,
            info=info,
            levels=levels,
            is_plain=is_plain,
            default_level_name=default_level_name,
        )

        for level in levels:
            for attr in level.attributes:
                attr.dimension = dimension

        dimension.validate()

        return dimension
Create a dimension from a `model` dictionary.  Some rules:

        * ``levels`` might contain level names as strings - names of levels to
          inherit from the template
        
Create a dimension from a `model` dictionary.  Some rules:
``levels`` might contain level names as strings - names of levels to
inherit from the template
Create a dimension from a ` model ` dictionary . Some rules : ` ` levels ` ` might contain level names as strings - names of levels to inherit from the template
def load(cls, model_data):
        model_data = cls.expand_model(model_data)
        name = model_data.get('name')
        ref = model_data.get('ref')
        info = model_data.get('info', {})
        is_plain = model_data.get('is_plain')
        default_level_name = model_data.get('default_level', 'default')
        levels = cls.level_cls.load_list(model_data['levels'])
        dimension = cls(
            name=name,
            ref=ref,
            info=info,
            levels=levels,
            is_plain=is_plain,
            default_level_name=default_level_name,
        )
        for level in levels:
            for attr in level.attributes:
                attr.dimension = dimension
        dimension.validate()
        return dimension
def load ( cls , model_data ) : model_data = cls . expand_model ( model_data ) name = model_data . get ( 'name' ) ref = model_data . get ( 'ref' ) info = model_data . get ( 'info' , { } ) is_plain = model_data . get ( 'is_plain' ) default_level_name = model_data . get ( 'default_level' , 'default' ) levels = cls . level_cls . load_list ( model_data [ 'levels' ] ) dimension = cls ( name = name , ref = ref , info = info , levels = levels , is_plain = is_plain , default_level_name = default_level_name , ) for level in levels : for attr in level . attributes : attr . dimension = dimension dimension . validate ( ) return dimension
Create a dimension from a `model` dictionary.
Create a dimension from a ` model ` dictionary .
"""Create a dimension from a `model` dictionary.  Some rules:

        * ``levels`` might contain level names as strings - names of levels to
          inherit from the template
        """
cls
model_data