mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-08-31 11:57:01 +08:00
Merge branch 'master' into queryset_in_bulk
This commit is contained in:
@@ -11,7 +11,6 @@ class Node:
|
||||
parents: Set[Any] = ...
|
||||
def __init__(self, key: Tuple[str, str]) -> None: ...
|
||||
def __lt__(self, other: Union[Tuple[str, str], Node]) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __getitem__(self, item: int) -> str: ...
|
||||
def add_child(self, child: Node) -> None: ...
|
||||
def add_parent(self, parent: Node) -> None: ...
|
||||
@@ -19,13 +18,9 @@ class Node:
|
||||
def descendants(self) -> List[Tuple[str, str]]: ...
|
||||
|
||||
class DummyNode(Node):
|
||||
children: Set[Any]
|
||||
key: Tuple[str, str]
|
||||
parents: Set[Any]
|
||||
origin: Any = ...
|
||||
error_message: Any = ...
|
||||
def __init__(self, key: Tuple[str, str], origin: Union[Migration, str], error_message: str) -> None: ...
|
||||
__class__: Any = ...
|
||||
def promote(self) -> None: ...
|
||||
def raise_error(self) -> None: ...
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
from typing import Any, Dict, Optional, Set, Tuple, Union, Sequence
|
||||
from typing import Any, Dict, Optional, Sequence, Set, Tuple, Union
|
||||
|
||||
from django.db import DefaultConnectionProxy
|
||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.migrations.migration import Migration, SwappableTuple
|
||||
from django.db.migrations.state import ProjectState
|
||||
|
||||
from django.db import DefaultConnectionProxy
|
||||
|
||||
MIGRATIONS_MODULE_NAME: str
|
||||
|
||||
class MigrationLoader:
|
||||
|
||||
@@ -13,7 +13,6 @@ class Migration:
|
||||
name: str = ...
|
||||
app_label: str = ...
|
||||
def __init__(self, name: str, app_label: str) -> None: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def mutate_state(self, project_state: ProjectState, preserve: bool = ...) -> ProjectState: ...
|
||||
def apply(
|
||||
self, project_state: ProjectState, schema_editor: BaseDatabaseSchemaEditor, collect_sql: bool = ...
|
||||
@@ -24,6 +23,6 @@ class Migration:
|
||||
|
||||
class SwappableTuple(tuple):
|
||||
setting: str = ...
|
||||
def __new__(cls: Type[SwappableTuple], value: Tuple[str, str], setting: str) -> SwappableTuple: ...
|
||||
def __new__(cls, value: Tuple[str, str], setting: str) -> SwappableTuple: ...
|
||||
|
||||
def swappable_dependency(value: str) -> SwappableTuple: ...
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
# Stubs for django.db.migrations.operations (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from .fields import (
|
||||
AddField as AddField,
|
||||
AlterField as AlterField,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, List, Optional, Type
|
||||
from typing import Any, List
|
||||
|
||||
class Operation:
|
||||
reversible: bool = ...
|
||||
@@ -6,7 +6,6 @@ class Operation:
|
||||
atomic: bool = ...
|
||||
elidable: bool = ...
|
||||
serialization_expand_args: Any = ...
|
||||
def __new__(cls: Type[Operation], *args: Any, **kwargs: Any) -> Operation: ...
|
||||
def deconstruct(self): ...
|
||||
def state_forwards(self, app_label: Any, state: Any) -> None: ...
|
||||
def database_forwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any) -> None: ...
|
||||
|
||||
@@ -12,7 +12,6 @@ class ModelOperation(Operation):
|
||||
def name_lower(self) -> str: ...
|
||||
|
||||
class CreateModel(ModelOperation):
|
||||
serialization_expand_args: Any = ...
|
||||
fields: Sequence[Tuple[str, Field]] = ...
|
||||
options: Any = ...
|
||||
bases: Optional[Sequence[Union[type, str]]] = ...
|
||||
@@ -63,7 +62,6 @@ class AlterModelOptions(ModelOptionOperation):
|
||||
def __init__(self, name: str, options: Dict[str, Any]) -> None: ...
|
||||
|
||||
class AlterModelManagers(ModelOptionOperation):
|
||||
serialization_expand_args: Any = ...
|
||||
managers: Any = ...
|
||||
def __init__(self, name: Any, managers: Any) -> None: ...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Callable, Optional, Sequence, Dict
|
||||
from typing import Any, Callable, Dict, Optional, Sequence
|
||||
|
||||
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
|
||||
from django.db.migrations.state import StateApps
|
||||
@@ -6,7 +6,6 @@ from django.db.migrations.state import StateApps
|
||||
from .base import Operation
|
||||
|
||||
class SeparateDatabaseAndState(Operation):
|
||||
serialization_expand_args: Any = ...
|
||||
database_operations: Sequence[Operation] = ...
|
||||
state_operations: Sequence[Operation] = ...
|
||||
def __init__(
|
||||
@@ -19,7 +18,6 @@ class RunSQL(Operation):
|
||||
reverse_sql: Any = ...
|
||||
state_operations: Any = ...
|
||||
hints: Any = ...
|
||||
elidable: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
sql: Any,
|
||||
@@ -30,12 +28,9 @@ class RunSQL(Operation):
|
||||
) -> None: ...
|
||||
|
||||
class RunPython(Operation):
|
||||
reduces_to_sql: bool = ...
|
||||
atomic: bool = ...
|
||||
code: Callable = ...
|
||||
reverse_code: Optional[Callable] = ...
|
||||
hints: Optional[Dict[str, Any]] = ...
|
||||
elidable: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
code: Callable,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.db.migrations.state import ProjectState
|
||||
|
||||
from django.db.models.fields import Field
|
||||
|
||||
def is_referenced_by_foreign_key(state: ProjectState, model_name_lower: str, field: Field, field_name: str) -> bool: ...
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import Any, List, Optional
|
||||
from typing import List, Optional
|
||||
|
||||
from django.db.migrations.operations.base import Operation
|
||||
|
||||
class MigrationOptimizer:
|
||||
def optimize(self, operations: List[Operation], app_label: str = ...) -> List[Operation]: ...
|
||||
def optimize_inner(self, operations: List[Operation], app_label: str = ...) -> List[Operation]: ...
|
||||
def optimize(self, operations: List[Operation], app_label: Optional[str] = ...) -> List[Operation]: ...
|
||||
def optimize_inner(self, operations: List[Operation], app_label: Optional[str] = ...) -> List[Operation]: ...
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
from typing import Any, Dict, Optional, Set
|
||||
|
||||
from django.db.migrations.state import ModelState
|
||||
|
||||
from django.db.models.fields import Field
|
||||
|
||||
from .loader import MigrationLoader
|
||||
|
||||
class MigrationQuestioner:
|
||||
defaults: Dict[Any, Any] = ...
|
||||
specified_apps: Set[Any] = ...
|
||||
dry_run: None = ...
|
||||
defaults: Dict[str, Any] = ...
|
||||
specified_apps: Set[str] = ...
|
||||
dry_run: Optional[bool] = ...
|
||||
def __init__(
|
||||
self,
|
||||
defaults: Optional[Dict[str, bool]] = ...,
|
||||
@@ -23,21 +22,5 @@ class MigrationQuestioner:
|
||||
def ask_merge(self, app_label: str) -> bool: ...
|
||||
def ask_auto_now_add_addition(self, field_name: str, model_name: str) -> None: ...
|
||||
|
||||
class InteractiveMigrationQuestioner(MigrationQuestioner):
|
||||
defaults: Dict[Any, Any]
|
||||
dry_run: bool
|
||||
specified_apps: Set[str]
|
||||
def ask_not_null_addition(self, field_name: str, model_name: str) -> None: ...
|
||||
def ask_not_null_alteration(self, field_name: Any, model_name: Any): ...
|
||||
def ask_rename(self, model_name: Any, old_name: Any, new_name: Any, field_instance: Any): ...
|
||||
def ask_rename_model(self, old_model_state: Any, new_model_state: Any): ...
|
||||
def ask_merge(self, app_label: str) -> bool: ...
|
||||
def ask_auto_now_add_addition(self, field_name: str, model_name: str) -> int: ...
|
||||
|
||||
class NonInteractiveMigrationQuestioner(MigrationQuestioner):
|
||||
defaults: Dict[Any, Any]
|
||||
dry_run: bool
|
||||
specified_apps: Set[str]
|
||||
def ask_not_null_addition(self, field_name: Any, model_name: Any) -> None: ...
|
||||
def ask_not_null_alteration(self, field_name: Any, model_name: Any): ...
|
||||
def ask_auto_now_add_addition(self, field_name: Any, model_name: Any) -> None: ...
|
||||
class InteractiveMigrationQuestioner(MigrationQuestioner): ...
|
||||
class NonInteractiveMigrationQuestioner(MigrationQuestioner): ...
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
from typing import Any, Optional, Set, Tuple, Union
|
||||
from typing import Any, Optional, Set, Tuple
|
||||
|
||||
from django.db import models
|
||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||
from django.db.models.query import QuerySet
|
||||
|
||||
from django.db import models
|
||||
|
||||
class MigrationRecorder:
|
||||
class Migration(models.Model):
|
||||
app: Any = ...
|
||||
|
||||
@@ -1,88 +1,40 @@
|
||||
from typing import Any, Callable, Dict, List, Set, Tuple, Union
|
||||
|
||||
from django.db.models.fields import Field
|
||||
|
||||
class BaseSerializer:
|
||||
value: Any = ...
|
||||
def __init__(self, value: Any) -> None: ...
|
||||
def serialize(self) -> None: ...
|
||||
def serialize(self) -> Any: ...
|
||||
|
||||
class BaseSequenceSerializer(BaseSerializer):
|
||||
def serialize(self) -> Tuple[str, Set[str]]: ...
|
||||
|
||||
class BaseSimpleSerializer(BaseSerializer):
|
||||
value: str
|
||||
def serialize(self) -> Tuple[str, Set[Any]]: ...
|
||||
|
||||
class DatetimeSerializer(BaseSerializer):
|
||||
value: Any = ...
|
||||
def serialize(self): ...
|
||||
|
||||
class DateSerializer(BaseSerializer):
|
||||
def serialize(self): ...
|
||||
|
||||
class DecimalSerializer(BaseSerializer):
|
||||
def serialize(self): ...
|
||||
class BaseSequenceSerializer(BaseSerializer): ...
|
||||
class BaseSimpleSerializer(BaseSerializer): ...
|
||||
class DatetimeSerializer(BaseSerializer): ...
|
||||
class DateSerializer(BaseSerializer): ...
|
||||
class DecimalSerializer(BaseSerializer): ...
|
||||
|
||||
class DeconstructableSerializer(BaseSerializer):
|
||||
@staticmethod
|
||||
def serialize_deconstructed(
|
||||
path: str, args: List[Any], kwargs: Dict[str, Union[Callable, int, str]]
|
||||
) -> Tuple[str, Set[str]]: ...
|
||||
def serialize(self): ...
|
||||
|
||||
class DictionarySerializer(BaseSerializer):
|
||||
def serialize(self): ...
|
||||
|
||||
class EnumSerializer(BaseSerializer):
|
||||
def serialize(self): ...
|
||||
|
||||
class FloatSerializer(BaseSimpleSerializer):
|
||||
def serialize(self): ...
|
||||
|
||||
class DictionarySerializer(BaseSerializer): ...
|
||||
class EnumSerializer(BaseSerializer): ...
|
||||
class FloatSerializer(BaseSimpleSerializer): ...
|
||||
class FrozensetSerializer(BaseSequenceSerializer): ...
|
||||
|
||||
class FunctionTypeSerializer(BaseSerializer):
|
||||
value: Callable
|
||||
def serialize(self) -> Tuple[str, Set[str]]: ...
|
||||
|
||||
class FunctoolsPartialSerializer(BaseSerializer):
|
||||
def serialize(self): ...
|
||||
|
||||
class IterableSerializer(BaseSerializer):
|
||||
def serialize(self): ...
|
||||
|
||||
class ModelFieldSerializer(DeconstructableSerializer):
|
||||
value: Field
|
||||
def serialize(self) -> Tuple[str, Set[str]]: ...
|
||||
|
||||
class ModelManagerSerializer(DeconstructableSerializer):
|
||||
def serialize(self): ...
|
||||
|
||||
class OperationSerializer(BaseSerializer):
|
||||
def serialize(self): ...
|
||||
|
||||
class RegexSerializer(BaseSerializer):
|
||||
def serialize(self): ...
|
||||
|
||||
class FunctionTypeSerializer(BaseSerializer): ...
|
||||
class FunctoolsPartialSerializer(BaseSerializer): ...
|
||||
class IterableSerializer(BaseSerializer): ...
|
||||
class ModelFieldSerializer(DeconstructableSerializer): ...
|
||||
class ModelManagerSerializer(DeconstructableSerializer): ...
|
||||
class OperationSerializer(BaseSerializer): ...
|
||||
class RegexSerializer(BaseSerializer): ...
|
||||
class SequenceSerializer(BaseSequenceSerializer): ...
|
||||
class SetSerializer(BaseSequenceSerializer): ...
|
||||
|
||||
class SettingsReferenceSerializer(BaseSerializer):
|
||||
def serialize(self): ...
|
||||
|
||||
class TimedeltaSerializer(BaseSerializer):
|
||||
def serialize(self): ...
|
||||
|
||||
class TimeSerializer(BaseSerializer):
|
||||
def serialize(self): ...
|
||||
|
||||
class SettingsReferenceSerializer(BaseSerializer): ...
|
||||
class TimedeltaSerializer(BaseSerializer): ...
|
||||
class TimeSerializer(BaseSerializer): ...
|
||||
class TupleSerializer(BaseSequenceSerializer): ...
|
||||
|
||||
class TypeSerializer(BaseSerializer):
|
||||
def serialize(self): ...
|
||||
|
||||
class UUIDSerializer(BaseSerializer):
|
||||
def serialize(self): ...
|
||||
class TypeSerializer(BaseSerializer): ...
|
||||
class UUIDSerializer(BaseSerializer): ...
|
||||
|
||||
def serializer_factory(value: Any) -> BaseSerializer: ...
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
from typing import Any, Dict, Iterator, List, Optional, Tuple, Type, DefaultDict, Union, Sequence
|
||||
from typing import Any, DefaultDict, Dict, Iterator, List, Optional, Sequence, Tuple, Type, Union
|
||||
|
||||
from django.apps.registry import Apps
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.manager import Manager
|
||||
from django.utils.functional import cached_property
|
||||
|
||||
from django.db.models.fields import Field
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Dict, Iterator, List, Optional, Set
|
||||
from typing import Dict, Iterator, List, Set
|
||||
|
||||
from django.db.migrations.operations.base import Operation
|
||||
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.utils.functional import SimpleLazyObject
|
||||
from typing import Any
|
||||
|
||||
COMPILED_REGEX_TYPE: Any
|
||||
|
||||
class RegexObject:
|
||||
pattern: str = ...
|
||||
flags: int = ...
|
||||
def __init__(self, obj: SimpleLazyObject) -> None: ...
|
||||
def __init__(self, obj: Any) -> None: ...
|
||||
|
||||
def get_migration_name_timestamp() -> str: ...
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
from typing import Any, Optional, Set, Tuple, Type, List, Union
|
||||
from typing import Any, List, Set, Tuple, Union
|
||||
|
||||
from django.db.migrations.migration import Migration
|
||||
from django.db.migrations.operations.base import Operation
|
||||
|
||||
from django.db.migrations.operations.models import CreateModel
|
||||
|
||||
class SettingsReference(str):
|
||||
def __new__(self: Type[SettingsReference], value: str, setting_name: str) -> SettingsReference: ...
|
||||
setting_name: str = ...
|
||||
def __init__(self, value: str, setting_name: str) -> None: ...
|
||||
|
||||
class OperationWriter:
|
||||
|
||||
Reference in New Issue
Block a user