TransactionManagementError (db/transaction.py)

django · django/db/transaction.py · python · BSD-3-Clause
database

Core Django module for database transaction handling and atomic blocks.

# Source: https://github.com/django/django | License: BSD-3-Clause | Copyright Django Software Foundation and individual contributors
# Provided via justclaw.it.com; keep this notice with the code.
import warnings
from asyncio import iscoroutinefunction
from contextlib import ContextDecorator, contextmanager
from functools import wraps

from django.db import (
    DEFAULT_DB_ALIAS,
    DatabaseError,
    Error,
    ProgrammingError,
    connections,
)
from django.utils.deprecation import RemovedInDjango2028Warning
from django.utils.warnings import django_file_prefixes


class TransactionManagementError(ProgrammingError):
    """Transaction management is used improperly."""

    pass


def get_connection(using=None):
    """
    Get a database connection by name, or the default database con

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key