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

@@ -45,7 +45,9 @@ class BaseDatabaseWrapper:
features: Any = ...
introspection: Any = ...
validation: Any = ...
def __init__(self, settings_dict: Dict[str, Dict[str, str]], alias: str = ..., allow_thread_sharing: bool = ...) -> None: ...
def __init__(
self, settings_dict: Dict[str, Dict[str, str]], alias: str = ..., allow_thread_sharing: bool = ...
) -> None: ...
def ensure_timezone(self) -> bool: ...
def timezone(self): ...
def timezone_name(self): ...

View File

@@ -7,8 +7,12 @@ TEST_DATABASE_PREFIX: str
class BaseDatabaseCreation:
connection: django.db.backends.sqlite3.base.DatabaseWrapper = ...
def __init__(self, connection: BaseDatabaseWrapper) -> None: ...
def create_test_db(self, verbosity: int = ..., autoclobber: bool = ..., serialize: bool = ..., keepdb: bool = ...) -> str: ...
def set_as_test_mirror(self, primary_settings_dict: Dict[str, Optional[Union[Dict[str, None], int, str]]]) -> None: ...
def create_test_db(
self, verbosity: int = ..., autoclobber: bool = ..., serialize: bool = ..., keepdb: bool = ...
) -> str: ...
def set_as_test_mirror(
self, primary_settings_dict: Dict[str, Optional[Union[Dict[str, None], int, str]]]
) -> None: ...
def serialize_db_to_string(self) -> str: ...
def deserialize_db_from_string(self, data: str) -> None: ...
def clone_test_db(self, suffix: Any, verbosity: int = ..., autoclobber: bool = ..., keepdb: bool = ...) -> None: ...

View File

@@ -17,8 +17,12 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
data_types_reverse: Any = ...
def get_table_list(self, cursor: CursorWrapper) -> List[TableInfo]: ...
def get_table_description(self, cursor: CursorWrapper, table_name: str) -> List[FieldInfo]: ...
def get_sequences(self, cursor: CursorWrapper, table_name: str, table_fields: List[Field] = ...) -> List[Dict[str, str]]: ...
def get_sequences(
self, cursor: CursorWrapper, table_name: str, table_fields: List[Field] = ...
) -> List[Dict[str, str]]: ...
def get_relations(self, cursor: CursorWrapper, table_name: str) -> Dict[str, Tuple[str, str]]: ...
def get_key_columns(self, cursor: CursorWrapper, table_name: str) -> List[Tuple[str, str, str]]: ...
def get_primary_key_column(self, cursor: CursorWrapper, table_name: str) -> Optional[str]: ...
def get_constraints(self, cursor: CursorWrapper, table_name: str) -> Dict[str, Dict[str, Union[List[str], bool]]]: ...
def get_constraints(
self, cursor: CursorWrapper, table_name: str
) -> Dict[str, Dict[str, Union[List[str], bool]]]: ...

View File

@@ -16,7 +16,9 @@ class DatabaseOperations(BaseDatabaseOperations):
cast_char_field_without_max_length: str = ...
cast_data_types: Any = ...
explain_prefix: str = ...
def bulk_batch_size(self, fields: Union[List[Field], List[str], ImmutableList], objs: Union[List[Model], range]) -> int: ...
def bulk_batch_size(
self, fields: Union[List[Field], List[str], ImmutableList], objs: Union[List[Model], range]
) -> int: ...
def check_expression_support(self, expression: Union[BaseExpression, SQLiteNumericMixin]) -> None: ...
def date_extract_sql(self, lookup_type: str, field_name: str) -> str: ...
def date_interval_sql(self, timedelta: timedelta) -> str: ...
@@ -54,12 +56,16 @@ class DatabaseOperations(BaseDatabaseOperations):
self, value: Optional[Union[time, str]], expression: Expression, connection: DatabaseWrapper
) -> Optional[time]: ...
def get_decimalfield_converter(self, expression: Expression) -> Callable: ...
def convert_uuidfield_value(self, value: Optional[str], expression: Col, connection: DatabaseWrapper) -> Optional[UUID]: ...
def convert_uuidfield_value(
self, value: Optional[str], expression: Col, connection: DatabaseWrapper
) -> Optional[UUID]: ...
def convert_booleanfield_value(
self, value: Optional[int], expression: Expression, connection: DatabaseWrapper
) -> Optional[bool]: ...
def bulk_insert_sql(
self, fields: Union[List[None], List[Field], ImmutableList], placeholder_rows: Union[List[Any], Tuple[Tuple[str]]]
self,
fields: Union[List[None], List[Field], ImmutableList],
placeholder_rows: Union[List[Any], Tuple[Tuple[str]]],
) -> str: ...
def combine_expression(self, connector: str, sub_expressions: List[str]) -> str: ...
def combine_duration_expression(self, connector: str, sub_expressions: List[str]) -> str: ...

View File

@@ -35,5 +35,7 @@ def typecast_timestamp(s: Optional[str]) -> Optional[date]: ...
def rev_typecast_decimal(d: Decimal) -> str: ...
def split_identifier(identifier: str) -> Tuple[str, str]: ...
def truncate_name(identifier: str, length: Optional[int] = ..., hash_len: int = ...) -> str: ...
def format_number(value: Optional[Decimal], max_digits: Optional[int], decimal_places: Optional[int]) -> Optional[str]: ...
def format_number(
value: Optional[Decimal], max_digits: Optional[int], decimal_places: Optional[int]
) -> Optional[str]: ...
def strip_quotes(table_name: str) -> str: ...