mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-15 16:27:09 +08:00
* Fix CI
* Fix CI
* Fix CI
* Fix CI
* APply black
* APply black
* Fix mypy
* Fix mypy errors in django-stubs
* Fix format
* Fix plugin
* Do not patch builtins by default
* Fix mypy
* Only run mypy on 3.10 for now
* Only run mypy on 3.10 for now
* WHAT THE HELL
* Enable strict mode in mypy
* Enable strict mode in mypy
* Fix tests
* Fix tests
* Debug
* Debug
* Fix tests
* Fix tests
* Add TYPE_CHECKING debug
* Caching maybe?
* Caching maybe?
* Try explicit `${{ matrix.python-version }}`
* Remove debug
* Fix typing
* Finally
53 lines
2.0 KiB
Python
53 lines
2.0 KiB
Python
from typing import Any, Dict, Mapping, Optional, Sequence, Tuple, Union
|
|
|
|
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
|
|
from django.db.migrations.state import StateApps
|
|
from django.utils.datastructures import _ListOrTuple
|
|
from typing_extensions import Literal, Protocol
|
|
|
|
from .base import Operation
|
|
|
|
class SeparateDatabaseAndState(Operation):
|
|
database_operations: Sequence[Operation] = ...
|
|
state_operations: Sequence[Operation] = ...
|
|
def __init__(
|
|
self, database_operations: Sequence[Operation] = ..., state_operations: Sequence[Operation] = ...
|
|
) -> None: ...
|
|
|
|
class RunSQL(Operation):
|
|
noop: Literal[""] = ...
|
|
sql: Union[str, _ListOrTuple[Union[str, Tuple[str, Union[Dict[str, Any], Optional[_ListOrTuple[str]]]]]]] = ...
|
|
reverse_sql: Optional[
|
|
Union[str, _ListOrTuple[Union[str, Tuple[str, Union[Dict[str, Any], Optional[_ListOrTuple[str]]]]]]]
|
|
] = ...
|
|
state_operations: Sequence[Operation] = ...
|
|
hints: Mapping[str, Any] = ...
|
|
def __init__(
|
|
self,
|
|
sql: Union[str, _ListOrTuple[Union[str, Tuple[str, Union[Dict[str, Any], Optional[_ListOrTuple[str]]]]]]],
|
|
reverse_sql: Optional[
|
|
Union[str, _ListOrTuple[Union[str, Tuple[str, Union[Dict[str, Any], Optional[_ListOrTuple[str]]]]]]]
|
|
] = ...,
|
|
state_operations: Sequence[Operation] = ...,
|
|
hints: Optional[Mapping[str, Any]] = ...,
|
|
elidable: bool = ...,
|
|
) -> None: ...
|
|
|
|
class _CodeCallable(Protocol):
|
|
def __call__(self, __state_apps: StateApps, __shema_editor: BaseDatabaseSchemaEditor) -> None: ...
|
|
|
|
class RunPython(Operation):
|
|
code: _CodeCallable = ...
|
|
reverse_code: Optional[_CodeCallable] = ...
|
|
hints: Mapping[str, Any] = ...
|
|
def __init__(
|
|
self,
|
|
code: _CodeCallable,
|
|
reverse_code: Optional[_CodeCallable] = ...,
|
|
atomic: Optional[bool] = ...,
|
|
hints: Optional[Mapping[str, Any]] = ...,
|
|
elidable: bool = ...,
|
|
) -> None: ...
|
|
@staticmethod
|
|
def noop(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor) -> None: ...
|