def _marshall_definition(self, values, definition: 'mapping.Definition', entity, skip_none: bool, use_foreign_key: bool):
    d = self.response(definition.model_name, definition.model_key)
    attr = None
    if (definition.function and callable(definition.function)):
        attr = definition.function(entity)
    elif hasattr_(entity, definition.name):
        attr = getattr_(entity, definition.name, None)
    values[definition.name] = self.marshall(d, attr, skip_none=skip_none, as_list=False, use_foreign_key=use_foreign_key)
def _marshall_definition(self, values, definition: 'mapping.Definition', entity, skip_none: bool, use_foreign_key: bool):
    d = self.response(definition.model_name, definition.model_key)
    attr = None
    if (definition.function and callable(definition.function)):
        attr = definition.function(entity)
    elif hasattr_(entity, definition.name):
        attr = getattr_(entity, definition.name, None)
    values[definition.name] = self.marshall(d, attr, skip_none=skip_none, as_list=False, use_foreign_key=use_foreign_key)