@inject(app=Zsl)<EOL>def create_model_resource(resource_map, name, app=Injected):
try:<EOL><INDENT>resource_description = resource_map[name]<EOL>if len(resource_description) == <NUM_LIT:2>:<EOL><INDENT>module_name, model_name = resource_map[name]<EOL>resource_class = ModelResource<EOL><DEDENT>elif len(resource_description) == <NUM_LIT:3>:<EOL><INDENT>module_name, model_name, resource_class = resource_map[name]<EOL><DEDENT>else:<EOL><INDENT>raise ImportError("<STR_LIT>".format(name))<EOL><DEDENT><DEDENT>except KeyError:<EOL><INDENT>raise ImportError("<STR_LIT>".format(name))<EOL><DEDENT>module = importlib.import_module(module_name)<EOL>model_cls = getattr(module, model_name)<EOL>return app.injector.create_object(resource_class, {'<STR_LIT>': model_cls})<EOL>
Create a model resource from a dict ``resource_map``
    {'resource name': ('model package', 'model class')}

    :param resource_map: dict with resource descriptions
    :type resource_map: dict(str, tuple(str))
    :param name: name of the concrete resource
    :param app: current application, injected
    :type app: Zsl
    :return: instantiated model resource