mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-21 19:32:16 +08:00
39 lines
1.6 KiB
Python
39 lines
1.6 KiB
Python
# Stubs for django.db.transaction (Python 3.6)
|
|
#
|
|
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
|
|
|
from contextlib import ContextDecorator
|
|
from django.db import ProgrammingError
|
|
from typing import Any, Optional
|
|
|
|
from django.db.backends.sqlite3.base import DatabaseWrapper
|
|
from typing import Callable, Optional, Union
|
|
|
|
class TransactionManagementError(ProgrammingError): ...
|
|
|
|
def get_connection(using: Optional[str] = ...) -> DatabaseWrapper: ...
|
|
def get_autocommit(using: str = ...) -> bool: ...
|
|
def set_autocommit(autocommit: Any, using: Optional[Any] = ...): ...
|
|
def commit(using: None = ...) -> None: ...
|
|
def rollback(using: Optional[Any] = ...) -> None: ...
|
|
def savepoint(using: Optional[Any] = ...): ...
|
|
def savepoint_rollback(sid: str, using: None = ...) -> None: ...
|
|
def savepoint_commit(sid: Any, using: Optional[Any] = ...) -> None: ...
|
|
def clean_savepoints(using: Optional[Any] = ...) -> None: ...
|
|
def get_rollback(using: None = ...) -> bool: ...
|
|
def set_rollback(rollback: bool, using: Optional[str] = ...) -> None: ...
|
|
def on_commit(func: Callable, using: None = ...) -> None: ...
|
|
|
|
class Atomic(ContextDecorator):
|
|
using: Any = ...
|
|
savepoint: Any = ...
|
|
def __init__(self, using: Optional[str], savepoint: bool) -> None: ...
|
|
def __enter__(self) -> None: ...
|
|
def __exit__(self, exc_type: None, exc_value: None, traceback: None) -> None: ...
|
|
|
|
def atomic(
|
|
using: Optional[Union[str, Callable]] = ..., savepoint: bool = ...
|
|
) -> Callable: ...
|
|
def _non_atomic_requests(view: Any, using: Any): ...
|
|
def non_atomic_requests(using: Callable = ...) -> Callable: ...
|