utils.pyi
1 from typing import Any, Dict, Iterable, List, Optional 2 3 DEFAULT_DB_ALIAS: str 4 DJANGO_VERSION_PICKLE_KEY: str 5 6 class Error(Exception): ... 7 class InterfaceError(Error): ... 8 class DatabaseError(Error): ... 9 class DataError(DatabaseError): ... 10 class OperationalError(DatabaseError): ... 11 class IntegrityError(DatabaseError): ... 12 class InternalError(DatabaseError): ... 13 class ProgrammingError(DatabaseError): ... 14 class NotSupportedError(DatabaseError): ... 15 16 def load_backend(backend_name: str) -> Any: ... 17 18 class ConnectionDoesNotExist(Exception): ... 19 20 class ConnectionHandler: 21 databases: Dict[str, Dict[str, Optional[Any]]] 22 def __init__(self, databases: Dict[str, Dict[str, Optional[Any]]] = ...) -> None: ... 23 def ensure_defaults(self, alias: str) -> None: ... 24 def prepare_test_settings(self, alias: str) -> None: ... 25 def __getitem__(self, alias: str) -> Any: ... 26 def __setitem__(self, key: Any, value: Any) -> None: ... 27 def __delitem__(self, key: Any) -> None: ... 28 def __iter__(self): ... 29 def all(self) -> List[Any]: ... 30 def close_all(self) -> None: ... 31 32 class ConnectionRouter: 33 def __init__(self, routers: Optional[Iterable[Any]] = ...) -> None: ... 34 @property 35 def routers(self) -> List[Any]: ...