cubes_lite/model/dimension.py
def load(cls, model_data):
        """Create a level object from model."""

        model_data = cls.expand_model(model_data)

        try:
            name = model_data.pop('name')
        except KeyError:
            raise ModelError('No name specified in level model')

        attributes = cls.attribute_cls.load_list(model_data.pop('attributes', []))
        for attr in attributes:
            attr.validate()

        level = cls(name=name, attributes=attributes, **model_data)
        level.validate()
        return level
Create a level object from model.
Create a level object from model.
Create a level object from model .
def load(cls, model_data):
        model_data = cls.expand_model(model_data)
        try:
            name = model_data.pop('name')
        except KeyError:
            raise ModelError('No name specified in level model')
        attributes = cls.attribute_cls.load_list(model_data.pop('attributes', []))
        for attr in attributes:
            attr.validate()
        level = cls(name=name, attributes=attributes, **model_data)
        level.validate()
        return level
def load ( cls , model_data ) : model_data = cls . expand_model ( model_data ) try : name = model_data . pop ( 'name' ) except KeyError : raise ModelError ( 'No name specified in level model' ) attributes = cls . attribute_cls . load_list ( model_data . pop ( 'attributes' , [ ] ) ) for attr in attributes : attr . validate ( ) level = cls ( name = name , attributes = attributes , ** model_data ) level . validate ( ) return level
Create a level object from model.
Create a level object from model .
"""Create a level object from model."""
cls
model_data