def set_model_config(model_name, config, replace=False):
    """
    This function should be only used in initialization phrase
    :param model_name: model name it's should be string
    :param config: config should be dict. e.g.
        {'__mapping_only__', '__tablename__', '__ext_model__'}
    :param replace: if True, then replace original config, False will update
    """
    assert isinstance(model_name, str)
    assert isinstance(config, dict)
    
    d = __models__.setdefault(model_name, {})
    if replace:
        d['config'] = config
    else:
        c = d.setdefault('config', {})
        c.update(config)