run black over stubs, add checking to travis

This commit is contained in:
Maxim Kurnikov
2018-12-03 18:52:44 +03:00
parent d5bc7d4ab2
commit cf6119bf9b
420 changed files with 2295 additions and 8384 deletions

View File

@@ -2,12 +2,7 @@
#
# 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,
@@ -21,11 +16,7 @@ from .models import (
RemoveIndex as RemoveIndex,
RenameModel as RenameModel,
)
from .special import (
RunPython as RunPython,
RunSQL as RunSQL,
SeparateDatabaseAndState as SeparateDatabaseAndState,
)
from .special import RunPython as RunPython, RunSQL as RunSQL, SeparateDatabaseAndState as SeparateDatabaseAndState
from .fields import AddField, AlterField, RemoveField, RenameField
from .models import (
AddIndex,

View File

@@ -1,32 +1,18 @@
from typing import Any, List, Optional, Type
class Operation:
reversible: bool = ...
reduces_to_sql: bool = ...
atomic: bool = ...
elidable: bool = ...
serialization_expand_args: Any = ...
def __new__(
cls: Type[Operation], *args: Any, **kwargs: Any
) -> Operation: ...
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: ...
def database_backwards(
self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any
) -> None: ...
def database_forwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any) -> None: ...
def database_backwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any) -> None: ...
def describe(self): ...
def references_model(self, name: str, app_label: str = ...) -> bool: ...
def references_field(
self, model_name: str, name: str, app_label: str = ...
) -> bool: ...
def references_field(self, model_name: str, name: str, app_label: str = ...) -> bool: ...
def allow_migrate_model(self, connection_alias: Any, model: Any): ...
def reduce(
self,
operation: Operation,
in_between: List[Operation],
app_label: str = ...,
) -> bool: ...
def reduce(self, operation: Operation, in_between: List[Operation], app_label: str = ...) -> bool: ...

View File

@@ -8,7 +8,6 @@ from django.db.models.fields import Field, SlugField
from .base import Operation
from .utils import is_referenced_by_foreign_key
class FieldOperation(Operation):
model_name: Any = ...
name: Any = ...
@@ -17,54 +16,24 @@ class FieldOperation(Operation):
def name_lower(self) -> str: ...
def is_same_model_operation(self, operation: FieldOperation) -> bool: ...
def is_same_field_operation(self, operation: AddField) -> bool: ...
def references_model(
self, name: str, app_label: Optional[str] = ...
) -> bool: ...
def references_field(
self, model_name: str, name: str, app_label: str = ...
) -> bool: ...
def reduce(
self,
operation: Operation,
in_between: List[Operation],
app_label: str = ...,
) -> bool: ...
def references_model(self, name: str, app_label: Optional[str] = ...) -> bool: ...
def references_field(self, model_name: str, name: str, app_label: str = ...) -> bool: ...
def reduce(self, operation: Operation, in_between: List[Operation], app_label: str = ...) -> bool: ...
class AddField(FieldOperation):
field: Any = ...
preserve_default: Any = ...
def __init__(
self,
model_name: str,
name: str,
field: Field,
preserve_default: bool = ...,
) -> None: ...
def deconstruct(
self
) -> Tuple[str, List[Any], Dict[str, Union[bool, Field, str]]]: ...
def __init__(self, model_name: str, name: str, field: Field, preserve_default: bool = ...) -> None: ...
def deconstruct(self) -> Tuple[str, List[Any], Dict[str, Union[bool, Field, str]]]: ...
def state_forwards(self, app_label: str, state: ProjectState) -> None: ...
def database_forwards(
self,
app_label: str,
schema_editor: DatabaseSchemaEditor,
from_state: ProjectState,
to_state: ProjectState,
self, app_label: str, schema_editor: DatabaseSchemaEditor, from_state: ProjectState, to_state: ProjectState
) -> None: ...
def database_backwards(
self,
app_label: str,
schema_editor: DatabaseSchemaEditor,
from_state: ProjectState,
to_state: ProjectState,
self, app_label: str, schema_editor: DatabaseSchemaEditor, from_state: ProjectState, to_state: ProjectState
) -> None: ...
def describe(self) -> str: ...
def reduce(
self,
operation: Operation,
in_between: List[Operation],
app_label: str = ...,
) -> bool: ...
def reduce(self, operation: Operation, in_between: List[Operation], app_label: str = ...) -> bool: ...
class RemoveField(FieldOperation):
model_name: str
@@ -73,73 +42,36 @@ class RemoveField(FieldOperation):
def deconstruct(self) -> Tuple[str, List[Any], Dict[str, str]]: ...
def state_forwards(self, app_label: str, state: ProjectState) -> None: ...
def database_forwards(
self,
app_label: str,
schema_editor: DatabaseSchemaEditor,
from_state: ProjectState,
to_state: ProjectState,
self, app_label: str, schema_editor: DatabaseSchemaEditor, from_state: ProjectState, to_state: ProjectState
) -> None: ...
def database_backwards(
self,
app_label: str,
schema_editor: DatabaseSchemaEditor,
from_state: ProjectState,
to_state: ProjectState,
self, app_label: str, schema_editor: DatabaseSchemaEditor, from_state: ProjectState, to_state: ProjectState
) -> None: ...
def describe(self) -> str: ...
class AlterField(FieldOperation):
field: Any = ...
preserve_default: Any = ...
def __init__(
self,
model_name: str,
name: str,
field: Field,
preserve_default: bool = ...,
) -> None: ...
def deconstruct(
self
) -> Tuple[str, List[Any], Dict[str, Union[SlugField, str]]]: ...
def __init__(self, model_name: str, name: str, field: Field, preserve_default: bool = ...) -> None: ...
def deconstruct(self) -> Tuple[str, List[Any], Dict[str, Union[SlugField, str]]]: ...
def state_forwards(self, app_label: str, state: ProjectState) -> None: ...
def database_forwards(
self,
app_label: str,
schema_editor: DatabaseSchemaEditor,
from_state: ProjectState,
to_state: ProjectState,
) -> None: ...
def database_backwards(
self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any
self, app_label: str, schema_editor: DatabaseSchemaEditor, from_state: ProjectState, to_state: ProjectState
) -> None: ...
def database_backwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any) -> None: ...
def describe(self) -> str: ...
def reduce(
self,
operation: Operation,
in_between: List[AlterField],
app_label: str = ...,
) -> bool: ...
def reduce(self, operation: Operation, in_between: List[AlterField], app_label: str = ...) -> bool: ...
class RenameField(FieldOperation):
old_name: Any = ...
new_name: Any = ...
def __init__(
self, model_name: str, old_name: str, new_name: str
) -> None: ...
def __init__(self, model_name: str, old_name: str, new_name: str) -> None: ...
def old_name_lower(self): ...
def new_name_lower(self) -> str: ...
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: ...
def database_backwards(
self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any
) -> None: ...
def database_forwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any) -> None: ...
def database_backwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any) -> None: ...
def describe(self): ...
def references_field(
self, model_name: str, name: str, app_label: str = ...
) -> bool: ...
def reduce(
self, operation: Operation, in_between: List[Any], app_label: str = ...
) -> bool: ...
def references_field(self, model_name: str, name: str, app_label: str = ...) -> bool: ...
def reduce(self, operation: Operation, in_between: List[Any], app_label: str = ...) -> bool: ...

View File

@@ -8,25 +8,12 @@ from django.db.models.fields import Field
from django.db.models.indexes import Index
from django.db.models.manager import Manager
class ModelOperation(Operation):
name: Any = ...
def __init__(self, name: str) -> None: ...
def name_lower(self) -> str: ...
def references_model(
self, name: str, app_label: Optional[str] = ...
) -> bool: ...
def reduce(
self,
operation: Operation,
in_between: List[Operation],
app_label: str = ...,
) -> bool: ...
def references_model(self, name: str, app_label: Optional[str] = ...) -> bool: ...
def reduce(self, operation: Operation, in_between: List[Operation], app_label: str = ...) -> bool: ...
class CreateModel(ModelOperation):
serialization_expand_args: Any = ...
@@ -34,337 +21,151 @@ class CreateModel(ModelOperation):
options: Any = ...
bases: Any = ...
managers: Any = ...
def __init__(
self,
name: str,
fields: List[Tuple[str, Union[CIText, Field]]],
options: Optional[Dict[str, Any]] = ...,
bases: Optional[
Union[Tuple[Type[Any], ...],
Tuple[str, ...]]] = ...,
managers: Optional[List[Tuple[str, Manager]]] = ...,
self,
name: str,
fields: List[Tuple[str, Union[CIText, Field]]],
options: Optional[Dict[str, Any]] = ...,
bases: Optional[Union[Tuple[Type[Any], ...], Tuple[str, ...]]] = ...,
managers: Optional[List[Tuple[str, Manager]]] = ...,
) -> None: ...
def deconstruct(
self
) -> Tuple[
str,
List[Any],
Dict[str, Union[Dict[str, str], List[Tuple[str, Field]], str]],
]: ...
def deconstruct(self) -> Tuple[str, List[Any], Dict[str, Union[Dict[str, str], List[Tuple[str, Field]], str]]]: ...
def state_forwards(self, app_label: str, state: ProjectState) -> None: ...
def database_forwards(
self,
app_label: str,
schema_editor: DatabaseSchemaEditor,
from_state: ProjectState,
to_state: ProjectState,
self, app_label: str, schema_editor: DatabaseSchemaEditor, from_state: ProjectState, to_state: ProjectState
) -> None: ...
def database_backwards(
self,
app_label: str,
schema_editor: DatabaseSchemaEditor,
from_state: ProjectState,
to_state: ProjectState,
self, app_label: str, schema_editor: DatabaseSchemaEditor, from_state: ProjectState, to_state: ProjectState
) -> None: ...
def describe(self) -> str: ...
def references_model(self, name: str, app_label: str = ...) -> bool: ...
def model_to_key(self, model: str) -> List[str]: ...
def reduce(
self,
operation: Operation,
in_between: List[Operation],
app_label: str = ...,
self, operation: Operation, in_between: List[Operation], app_label: str = ...
) -> Union[List[CreateModel], bool]: ...
class DeleteModel(ModelOperation):
def deconstruct(self) -> Tuple[str, List[Any], Dict[str, str]]: ...
def state_forwards(self, app_label: str, state: ProjectState) -> None: ...
def database_forwards(
self,
app_label: str,
schema_editor: DatabaseSchemaEditor,
from_state: ProjectState,
to_state: ProjectState,
self, app_label: str, schema_editor: DatabaseSchemaEditor, from_state: ProjectState, to_state: ProjectState
) -> None: ...
def database_backwards(
self,
app_label: str,
schema_editor: DatabaseSchemaEditor,
from_state: ProjectState,
to_state: ProjectState,
self, app_label: str, schema_editor: DatabaseSchemaEditor, from_state: ProjectState, to_state: ProjectState
) -> None: ...
def describe(self) -> str: ...
class RenameModel(ModelOperation):
old_name: Any = ...
new_name: Any = ...
def __init__(self, old_name: str, new_name: str) -> None: ...
def old_name_lower(self) -> str: ...
def new_name_lower(self) -> str: ...
def deconstruct(self): ...
def state_forwards(self, app_label: str, state: ProjectState) -> None: ...
def database_forwards(
self,
app_label: str,
schema_editor: DatabaseSchemaEditor,
from_state: ProjectState,
to_state: ProjectState,
self, app_label: str, schema_editor: DatabaseSchemaEditor, from_state: ProjectState, to_state: ProjectState
) -> None: ...
def database_backwards(
self,
app_label: str,
schema_editor: DatabaseSchemaEditor,
from_state: ProjectState,
to_state: ProjectState,
self, app_label: str, schema_editor: DatabaseSchemaEditor, from_state: ProjectState, to_state: ProjectState
) -> None: ...
def references_model(self, name: Any, app_label: Optional[Any] = ...): ...
def describe(self): ...
def reduce(
self,
operation: AlterModelTable,
in_between: List[Any],
app_label: str = ...,
) -> bool: ...
def reduce(self, operation: AlterModelTable, in_between: List[Any], app_label: str = ...) -> bool: ...
class AlterModelTable(ModelOperation):
table: Any = ...
def __init__(self, name: str, table: Optional[str]) -> None: ...
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: ...
def database_backwards(
self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any
): ...
def database_forwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any) -> None: ...
def database_backwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any): ...
def describe(self): ...
def reduce(
self, operation: Any, in_between: Any, app_label: Optional[Any] = ...
): ...
def reduce(self, operation: Any, in_between: Any, app_label: Optional[Any] = ...): ...
class ModelOptionOperation(ModelOperation):
def reduce(
self,
operation: Operation,
in_between: List[DeleteModel],
app_label: str = ...,
) -> bool: ...
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 = ...
unique_together: Any = ...
def __init__(
self, name: str, unique_together: Set[Tuple[str, ...]]
) -> None: ...
def deconstruct(
self
) -> Tuple[str, List[Any], Dict[str, Union[Set[Tuple[str, str]], str]]]: ...
def __init__(self, name: str, unique_together: Set[Tuple[str, ...]]) -> None: ...
def deconstruct(self) -> Tuple[str, List[Any], Dict[str, Union[Set[Tuple[str, str]], str]]]: ...
def state_forwards(self, app_label: str, state: ProjectState) -> None: ...
def database_forwards(
self,
app_label: str,
schema_editor: DatabaseSchemaEditor,
from_state: ProjectState,
to_state: ProjectState,
self, app_label: str, schema_editor: DatabaseSchemaEditor, from_state: ProjectState, to_state: ProjectState
) -> None: ...
def database_backwards(
self,
app_label: str,
schema_editor: DatabaseSchemaEditor,
from_state: ProjectState,
to_state: ProjectState,
self, app_label: str, schema_editor: DatabaseSchemaEditor, from_state: ProjectState, to_state: ProjectState
) -> None: ...
def references_field(
self, model_name: str, name: str, app_label: Optional[str] = ...
) -> bool: ...
def references_field(self, model_name: str, name: str, app_label: Optional[str] = ...) -> bool: ...
def describe(self) -> str: ...
class AlterIndexTogether(FieldRelatedOptionOperation):
option_name: str = ...
index_together: Any = ...
def __init__(
self, name: str, index_together: Set[Tuple[str, str]]
) -> None: ...
def __init__(self, name: str, index_together: Set[Tuple[str, str]]) -> None: ...
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: ...
def database_backwards(
self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any
): ...
def references_field(
self, model_name: str, name: str, app_label: Optional[str] = ...
) -> bool: ...
def database_forwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any) -> None: ...
def database_backwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any): ...
def references_field(self, model_name: str, name: str, app_label: Optional[str] = ...) -> bool: ...
def describe(self): ...
class AlterOrderWithRespectTo(FieldRelatedOptionOperation):
name: str
order_with_respect_to: str = ...
def __init__(self, name: str, order_with_respect_to: str) -> None: ...
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: ...
def database_backwards(
self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any
) -> None: ...
def references_field(
self, model_name: str, name: str, app_label: None = ...
) -> bool: ...
def database_forwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any) -> None: ...
def database_backwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any) -> None: ...
def references_field(self, model_name: str, name: str, app_label: None = ...) -> bool: ...
def describe(self): ...
class AlterModelOptions(ModelOptionOperation):
ALTER_OPTION_KEYS: Any = ...
options: Any = ...
def __init__(self, name: str, options: Dict[str, str]) -> None: ...
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: ...
def database_backwards(
self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any
) -> None: ...
def database_forwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any) -> None: ...
def database_backwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any) -> None: ...
def describe(self): ...
class AlterModelManagers(ModelOptionOperation):
serialization_expand_args: Any = ...
managers: Any = ...
def __init__(self, name: Any, managers: Any) -> None: ...
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: ...
def database_backwards(
self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any
) -> None: ...
def database_forwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any) -> None: ...
def database_backwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any) -> None: ...
def describe(self): ...
class IndexOperation(Operation):
option_name: str = ...
def model_name_lower(self): ...
class AddIndex(IndexOperation):
model_name: str = ...
index: django.db.models.indexes.Index = ...
def __init__(self, model_name: str, index: Index) -> None: ...
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: ...
def database_backwards(
self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any
) -> None: ...
def database_forwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any) -> None: ...
def database_backwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any) -> None: ...
def deconstruct(self): ...
def describe(self): ...
class RemoveIndex(IndexOperation):
model_name: str = ...
name: str = ...
def __init__(self, model_name: str, name: str) -> None: ...
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: ...
def database_backwards(
self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any
) -> None: ...
def database_forwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any) -> None: ...
def database_backwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any) -> None: ...
def deconstruct(self): ...
def describe(self): ...

View File

@@ -6,31 +6,18 @@ from django.db.migrations.state import ProjectState, StateApps
from .base import Operation
class SeparateDatabaseAndState(Operation):
serialization_expand_args: Any = ...
database_operations: Any = ...
state_operations: Any = ...
def __init__(
self,
database_operations: List[Any] = ...,
state_operations: List[CreateModel] = ...,
) -> None: ...
def __init__(self, database_operations: List[Any] = ..., state_operations: List[CreateModel] = ...) -> None: ...
def deconstruct(self): ...
def state_forwards(self, app_label: str, state: ProjectState) -> None: ...
def database_forwards(
self,
app_label: str,
schema_editor: DatabaseSchemaEditor,
from_state: ProjectState,
to_state: ProjectState,
self, app_label: str, schema_editor: DatabaseSchemaEditor, from_state: ProjectState, to_state: ProjectState
) -> None: ...
def database_backwards(
self,
app_label: str,
schema_editor: DatabaseSchemaEditor,
from_state: ProjectState,
to_state: ProjectState,
self, app_label: str, schema_editor: DatabaseSchemaEditor, from_state: ProjectState, to_state: ProjectState
) -> None: ...
def describe(self): ...
@@ -53,12 +40,8 @@ class RunSQL(Operation):
@property
def reversible(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: ...
def database_backwards(
self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any
) -> None: ...
def database_forwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any) -> None: ...
def database_backwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any) -> None: ...
def describe(self): ...
class RunPython(Operation):
@@ -81,18 +64,10 @@ class RunPython(Operation):
def reversible(self) -> bool: ...
def state_forwards(self, app_label: str, state: ProjectState) -> None: ...
def database_forwards(
self,
app_label: str,
schema_editor: DatabaseSchemaEditor,
from_state: ProjectState,
to_state: ProjectState,
self, app_label: str, schema_editor: DatabaseSchemaEditor, from_state: ProjectState, to_state: ProjectState
) -> None: ...
def database_backwards(
self,
app_label: str,
schema_editor: DatabaseSchemaEditor,
from_state: ProjectState,
to_state: ProjectState,
self, app_label: str, schema_editor: DatabaseSchemaEditor, from_state: ProjectState, to_state: ProjectState
) -> None: ...
def describe(self): ...
@staticmethod

View File

@@ -3,7 +3,4 @@ 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: ...
def is_referenced_by_foreign_key(state: ProjectState, model_name_lower: str, field: Field, field_name: str) -> bool: ...