d2a/__init__.py
def autoload(config=D2A_CONFIG.get('AUTOLOAD', {})):
    """It loads all models automatically.
    """
    module = config.get('module', 'models_sqla')
    option = config.get('option', {})
    for app in settings.INSTALLED_APPS:
        mods = app.split('.')
        for i in range(1, len(mods) + 1):
            mod = '.'.join(mods[:i])
            d = '{mod}.models'.format(mod=mod)
            a = '{mod}.{module}'.format(mod=mod, module=module)
            if importlib.util.find_spec(d) is None:
                continue
            try:
                importlib.import_module(a)
            except ImportError:
                sys.modules[a] = types.ModuleType(a)
                transfer(importlib.import_module(d), sys.modules[a].__dict__, **option)
It loads all models automatically.
    
It loads all models automatically.
It loads all models automatically .
def autoload(config=D2A_CONFIG.get('AUTOLOAD', {})):
    module = config.get('module', 'models_sqla')
    option = config.get('option', {})
    for app in settings.INSTALLED_APPS:
        mods = app.split('.')
        for i in range(1, len(mods) + 1):
            mod = '.'.join(mods[:i])
            d = '{mod}.models'.format(mod=mod)
            a = '{mod}.{module}'.format(mod=mod, module=module)
            if importlib.util.find_spec(d) is None:
                continue
            try:
                importlib.import_module(a)
            except ImportError:
                sys.modules[a] = types.ModuleType(a)
                transfer(importlib.import_module(d), sys.modules[a].__dict__, **option)
def autoload ( config = D2A_CONFIG . get ( 'AUTOLOAD' , { } ) ) : module = config . get ( 'module' , 'models_sqla' ) option = config . get ( 'option' , { } ) for app in settings . INSTALLED_APPS : mods = app . split ( '.' ) for i in range ( 1 , len ( mods ) + 1 ) : mod = '.' . join ( mods [ : i ] ) d = '{mod}.models' . format ( mod = mod ) a = '{mod}.{module}' . format ( mod = mod , module = module ) if importlib . util . find_spec ( d ) is None : continue try : importlib . import_module ( a ) except ImportError : sys . modules [ a ] = types . ModuleType ( a ) transfer ( importlib . import_module ( d ) , sys . modules [ a ] . __dict__ , ** option )
It loads all models automatically.
It loads all models automatically .
"""It loads all models automatically.
    """
config