@classmethod<EOL><INDENT>def from_model(cls, model_instance, default_value=False, **kwargs):<DEDENT>
if not isinstance(model_instance, DataCollection):<EOL><INDENT>raise TypeError("<STR_LIT>" % (model_instance.__class__.__name__))<EOL><DEDENT>elif isinstance(model_instance, Array) and model_instance.is_scalar:<EOL><INDENT>return AttributeFilter(is_array_scalar=True)<EOL><DEDENT>attribute_filter_instance = model_instance.get_attribute_filter(default_value)<EOL>for name, value in iter(kwargs.items()):<EOL><INDENT>if name in attribute_filter_instance:<EOL><INDENT>setattr(attribute_filter_instance, name, value)<EOL><DEDENT>else:<EOL><INDENT>raise KeyError(name)<EOL><DEDENT><DEDENT>return attribute_filter_instance<EOL>
wrapper for Model's get_attribute_filter