cubes_lite/model/dimension.py
def expand_model(cls, model_data):
        """Returns a level description as a dictionary."""

        if isinstance(model_data, compat.string_type):
            model_data = {'name': model_data, 'attributes': [model_data]}
        else:
            model_data = dict(model_data)

        try:
            name = model_data['name']
        except KeyError:
            raise ModelError('Level has no name')

        attributes = model_data.get('attributes')
        if not attributes:
            attributes = [{'name': name}]

        model_data['attributes'] = [
            Attribute.expand_model(a) for a in attributes
        ]

        return model_data
Returns a level description as a dictionary.
Returns a level description as a dictionary.
Returns a level description as a dictionary .
def expand_model(cls, model_data):
        if isinstance(model_data, compat.string_type):
            model_data = {'name': model_data, 'attributes': [model_data]}
        else:
            model_data = dict(model_data)
        try:
            name = model_data['name']
        except KeyError:
            raise ModelError('Level has no name')
        attributes = model_data.get('attributes')
        if not attributes:
            attributes = [{'name': name}]
        model_data['attributes'] = [
            Attribute.expand_model(a) for a in attributes
        ]
        return model_data
def expand_model ( cls , model_data ) : if isinstance ( model_data , compat . string_type ) : model_data = { 'name' : model_data , 'attributes' : [ model_data ] } else : model_data = dict ( model_data ) try : name = model_data [ 'name' ] except KeyError : raise ModelError ( 'Level has no name' ) attributes = model_data . get ( 'attributes' ) if not attributes : attributes = [ { 'name' : name } ] model_data [ 'attributes' ] = [ Attribute . expand_model ( a ) for a in attributes ] return model_data
Returns a level description as a dictionary.
Returns a level description as a dictionary .
"""Returns a level description as a dictionary."""
cls
model_data