black reformat, some fixes

This commit is contained in:
Maxim Kurnikov
2018-12-06 19:13:06 +03:00
parent 25a71a7ef5
commit 5ec2830ba6
108 changed files with 673 additions and 187 deletions

View File

@@ -28,7 +28,9 @@ class MigrationAutodetector:
def only_relation_agnostic_fields(
self, fields: List[Tuple[str, Field]]
) -> List[Tuple[str, List[Any], Dict[str, Union[Callable, int, str]]]]: ...
def check_dependency(self, operation: Operation, dependency: Tuple[str, str, Optional[str], Union[bool, str]]) -> bool: ...
def check_dependency(
self, operation: Operation, dependency: Tuple[str, str, Optional[str], Union[bool, str]]
) -> bool: ...
def add_operation(
self,
app_label: str,

View File

@@ -37,4 +37,6 @@ class MigrationExecutor:
) -> ProjectState: ...
def unapply_migration(self, state: ProjectState, migration: Migration, fake: bool = ...) -> ProjectState: ...
def check_replacements(self) -> None: ...
def detect_soft_applied(self, project_state: Optional[ProjectState], migration: Migration) -> Tuple[bool, ProjectState]: ...
def detect_soft_applied(
self, project_state: Optional[ProjectState], migration: Migration
) -> Tuple[bool, ProjectState]: ...

View File

@@ -2,7 +2,12 @@
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from .fields import AddField as AddField, AlterField as AlterField, RemoveField as RemoveField, RenameField as RenameField
from .fields import (
AddField as AddField,
AlterField as AlterField,
RemoveField as RemoveField,
RenameField as RenameField,
)
from .models import (
AddIndex as AddIndex,
AlterIndexTogether as AlterIndexTogether,

View File

@@ -87,7 +87,9 @@ class ModelOptionOperation(ModelOperation):
def reduce(self, operation: Operation, in_between: List[DeleteModel], app_label: str = ...) -> bool: ...
class FieldRelatedOptionOperation(ModelOptionOperation):
def reduce(self, operation: Operation, in_between: List[Any], app_label: str = ...) -> Union[List[Operation], bool]: ...
def reduce(
self, operation: Operation, in_between: List[Any], app_label: str = ...
) -> Union[List[Operation], bool]: ...
class AlterUniqueTogether(FieldRelatedOptionOperation):
option_name: str = ...

View File

@@ -10,7 +10,10 @@ class MigrationQuestioner:
specified_apps: Set[Any] = ...
dry_run: None = ...
def __init__(
self, defaults: Optional[Dict[str, bool]] = ..., specified_apps: Optional[Set[str]] = ..., dry_run: Optional[bool] = ...
self,
defaults: Optional[Dict[str, bool]] = ...,
specified_apps: Optional[Set[str]] = ...,
dry_run: Optional[bool] = ...,
) -> None: ...
def ask_initial(self, app_label: str) -> bool: ...
def ask_not_null_addition(self, field_name: str, model_name: str) -> None: ...

View File

@@ -75,7 +75,9 @@ class StateApps:
ready: bool
real_models: List[django.db.migrations.state.ModelState]
stored_app_configs: List[Any]
def __init__(self, real_apps: List[str], models: Dict[Tuple[str, str], ModelState], ignore_swappable: bool = ...) -> None: ...
def __init__(
self, real_apps: List[str], models: Dict[Tuple[str, str], ModelState], ignore_swappable: bool = ...
) -> None: ...
def bulk_update(self) -> Iterator[None]: ...
def clone(self) -> StateApps: ...
def render_multiple(self, model_states: List[ModelState]) -> None: ...

View File

@@ -3,4 +3,6 @@ from typing import Any, Dict, Iterator, List, Optional, Set
from django.db.migrations.operations.base import Operation
def topological_sort_as_sets(dependency_graph: Dict[Operation, Set[Operation]]) -> Iterator[Set[Operation]]: ...
def stable_topological_sort(l: List[Operation], dependency_graph: Dict[Operation, Set[Operation]]) -> List[Operation]: ...
def stable_topological_sort(
l: List[Operation], dependency_graph: Dict[Operation, Set[Operation]]
) -> List[Operation]: ...