# Path: src/concurrency/compat.py



import warnings
from django.core.exceptions import ImproperlyConfigured
from django.test.signals import setting_changed
from django.utils.module_loading import import_string
from .compat import get_callable
        from django.conf import settings

# List Editable Policy
# 0 do not save updated records, save others, show message to the user
# 1 abort whole transaction
CONCURRENCY_LIST_EDITABLE_POLICY_SILENT = 1
CONCURRENCY_LIST_EDITABLE_POLICY_ABORT_ALL = 2
CONCURRENCY_POLICY_RAISE = 4
CONCURRENCY_POLICY_CALLBACK = 8

LIST_EDITABLE_POLICIES = [CONCURRENCY_LIST_EDITABLE_POLICY_SILENT, CONCURRENCY_LIST_EDITABLE_POLICY_ABORT_ALL]


class AppSettings:
    defaults = {
        'ENABLED': True,
        'AUTO_CREATE_TRIGGERS': True,
        'MANUAL_TRIGGERS': False,  # deprecated: use AUTO_CREATE_TRIGGERS
        'FIELD_SIGNER': 'concurrency.forms.VersionFieldSigner',
        'POLICY': CONCURRENCY_LIST_EDITABLE_POLICY_SILENT,
        'CALLBACK': 'concurrency.views.callback',
        'HANDLER409': 'concurrency.views.conflict',
        'VERSION_FIELD_REQUIRED': True,
        'TRIGGERS_FACTORY': {
            'postgresql': "concurrency.triggers.PostgreSQL",
            'mysql': "concurrency.triggers.MySQL",
            'sqlite3': "concurrency.triggers.Sqlite3",
            'sqlite': "concurrency.triggers.Sqlite3",
        }
    }


# Path: src/concurrency/compat.py



# Path: src/concurrency/config.py
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.test.signals import setting_changed
from django.utils.module_loading import import_string
from .compat import get_callable
        from django.conf import settings


# List Editable Policy
# 0 do not save updated records, save others, show message to the user
# 1 abort whole transaction
CONCURRENCY_LIST_EDITABLE_POLICY_SILENT = 1
CONCURRENCY_LIST_EDITABLE_POLICY_ABORT_ALL = 2
CONCURRENCY_POLICY_RAISE = 4
CONCURRENCY_POLICY_CALLBACK = 8

LIST_EDITABLE_POLICIES = [CONCURRENCY_LIST_EDITABLE_POLICY_SILENT, CONCURRENCY_LIST_EDITABLE_POLICY_ABORT_ALL]


class AppSettings:
    defaults = {
        'ENABLED': True,
        'AUTO_CREATE_TRIGGERS': True,
        'MANUAL_TRIGGERS': False,  # deprecated: use AUTO_CREATE_TRIGGERS
        'FIELD_SIGNER': 'concurrency.forms.VersionFieldSigner',
        'POLICY': CONCURRENCY_LIST_EDITABLE_POLICY_SILENT,
        'CALLBACK': 'concurrency.views.callback',
        'HANDLER409': 'concurrency.views.conflict',
        'VERSION_FIELD_REQUIRED': True,
        'TRIGGERS_FACTORY': {
            'postgresql': "concurrency.triggers.PostgreSQL",
            'mysql': "concurrency.triggers.MySQL",
            'sqlite3': "concurrency.triggers.Sqlite3",
            'sqlite': "concurrency.triggers.Sqlite3",
        }
    }


    def __init__(self, prefix):