(sql_class)
Context manager used to disable syncing models from SQL
    to Couch via `model.save`. This is necessary to prevent
    syncs from happening when using functions like `Model.objects.create_or_update`
Context manager used to disable syncing models from SQL
    to Couch via `model.save`. This is necessary to prevent
    syncs from happening when using functions like `Model.objects.create_or_update`
Context manager used to disable syncing models from SQL to Couch via model . save . This is necessary to prevent syncs from happening when using functions like Model . objects . create_or_update
def disable_sync_to_couch(sql_class):
    """Context manager used to disable syncing models from SQL
    to Couch via `model.save`. This is necessary to prevent
    syncs from happening when using functions like `Model.objects.create_or_update`
    """
    if not hasattr(_thread_local, "disabled_models"):
        _thread_local.disabled_models = set()

    _thread_local.disabled_models.add(sql_class)
    try:
        yield
    finally:
        _thread_local.disabled_models.remove(sql_class)
def disable_sync_to_couch ( sql_class ) : if not hasattr ( _thread_local , "disabled_models" ) : _thread_local . disabled_models = set ( ) _thread_local . disabled_models . add ( sql_class ) try : yield finally : _thread_local . disabled_models . remove ( sql_class )