rom/util.py
def _connect(obj):
    '''
    Tries to get the _conn attribute from a model. Barring that, gets the
    global default connection using other methods.
    '''
    from .columns import MODELS
    if isinstance(obj, MODELS['Model']):
        obj = obj.__class__
    if hasattr(obj, '_conn'):
        return obj._conn
    if hasattr(obj, 'CONN'):
        return obj.CONN
    return get_connection()
def _connect(obj):
    '''
    Tries to get the _conn attribute from a model. Barring that, gets the
    global default connection using other methods.
    '''
    from .columns import MODELS
    if isinstance(obj, MODELS['Model']):
        obj = obj.__class__
    if hasattr(obj, '_conn'):
        return obj._conn
    if hasattr(obj, 'CONN'):
        return obj.CONN
    return get_connection()
def _connect ( obj ) : from . columns import MODELS if isinstance ( obj , MODELS [ 'Model' ] ) : obj = obj . __class__ if hasattr ( obj , '_conn' ) : return obj . _conn if hasattr ( obj , 'CONN' ) : return obj . CONN return get_connection ( )
Tries to get the _conn attribute from a model. Barring that, gets the
    global default connection using other methods.
Tries to get the _conn attribute from a model . Barring that gets the global default connection using other methods .