mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-08-13 19:31:05 +08:00
black reformat, some fixes
This commit is contained in:
@@ -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): ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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]]]: ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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]: ...
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 = ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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]: ...
|
||||
|
||||
@@ -20,7 +20,12 @@ class Aggregate(Func):
|
||||
def get_source_expressions(self) -> List[Union[Combinable, WhereNode]]: ...
|
||||
def set_source_expressions(self, exprs: List[Union[Expression, WhereNode]]) -> None: ...
|
||||
def resolve_expression(
|
||||
self, query: Query = ..., allow_joins: bool = ..., reuse: None = ..., summarize: bool = ..., for_save: bool = ...
|
||||
self,
|
||||
query: Query = ...,
|
||||
allow_joins: bool = ...,
|
||||
reuse: None = ...,
|
||||
summarize: bool = ...,
|
||||
for_save: bool = ...,
|
||||
) -> Aggregate: ...
|
||||
@property
|
||||
def default_alias(self) -> str: ...
|
||||
|
||||
@@ -11,7 +11,9 @@ class Deferred: ...
|
||||
|
||||
DEFERRED: Any
|
||||
|
||||
def subclass_exception(name: str, bases: Tuple[Type[Exception]], module: str, attached_to: Type[Model]) -> Type[Exception]: ...
|
||||
def subclass_exception(
|
||||
name: str, bases: Tuple[Type[Exception]], module: str, attached_to: Type[Model]
|
||||
) -> Type[Exception]: ...
|
||||
|
||||
class ModelBase(type):
|
||||
def __new__(
|
||||
|
||||
@@ -16,7 +16,9 @@ from django.db.models.sql.where import WhereNode
|
||||
from django.utils.tree import Node
|
||||
|
||||
class SQLiteNumericMixin:
|
||||
def as_sqlite(self, compiler: SQLCompiler, connection: DatabaseWrapper, **extra_context: Any) -> Tuple[str, List[float]]: ...
|
||||
def as_sqlite(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper, **extra_context: Any
|
||||
) -> Tuple[str, List[float]]: ...
|
||||
|
||||
class Combinable:
|
||||
ADD: str = ...
|
||||
@@ -112,7 +114,9 @@ class DurationExpression(CombinedExpression):
|
||||
def compile(
|
||||
self, side: Expression, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, Union[List[datetime], List[int]]]: ...
|
||||
def as_sql(self, compiler: SQLCompiler, connection: DatabaseWrapper) -> Tuple[str, Union[List[datetime], List[int]]]: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, Union[List[datetime], List[int]]]: ...
|
||||
|
||||
class TemporalSubtraction(CombinedExpression):
|
||||
output_field: Any = ...
|
||||
@@ -229,7 +233,12 @@ class Ref(Expression):
|
||||
def get_source_expressions(self) -> Union[List[Expression], List[SQLiteNumericMixin]]: ...
|
||||
def set_source_expressions(self, exprs: Any) -> None: ...
|
||||
def resolve_expression(
|
||||
self, query: Query = ..., allow_joins: bool = ..., reuse: None = ..., summarize: bool = ..., for_save: bool = ...
|
||||
self,
|
||||
query: Query = ...,
|
||||
allow_joins: bool = ...,
|
||||
reuse: None = ...,
|
||||
summarize: bool = ...,
|
||||
for_save: bool = ...,
|
||||
) -> Ref: ...
|
||||
def relabeled_clone(self, relabels: Dict[Optional[str], str]) -> Ref: ...
|
||||
def as_sql(self, compiler: SQLCompiler, connection: DatabaseWrapper) -> Tuple[str, List[Any]]: ...
|
||||
@@ -273,7 +282,9 @@ class Case(Expression):
|
||||
cases: Any = ...
|
||||
default: Any = ...
|
||||
extra: Any = ...
|
||||
def __init__(self, *cases: Any, default: Optional[Any] = ..., output_field: Optional[Any] = ..., **extra: Any) -> None: ...
|
||||
def __init__(
|
||||
self, *cases: Any, default: Optional[Any] = ..., output_field: Optional[Any] = ..., **extra: Any
|
||||
) -> None: ...
|
||||
def get_source_expressions(self) -> List[Expression]: ...
|
||||
def set_source_expressions(self, exprs: List[Expression]) -> None: ...
|
||||
def resolve_expression(
|
||||
|
||||
@@ -87,7 +87,9 @@ class Field(RegisterLookupMixin):
|
||||
error_messages: None = ...,
|
||||
) -> None: ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def get_col(self, alias: str, output_field: Optional[Union[Field, reverse_related.ForeignObjectRel]] = ...) -> Col: ...
|
||||
def get_col(
|
||||
self, alias: str, output_field: Optional[Union[Field, reverse_related.ForeignObjectRel]] = ...
|
||||
) -> Col: ...
|
||||
def cached_col(self) -> Col: ...
|
||||
def select_format(
|
||||
self, compiler: SQLCompiler, sql: str, params: List[Union[int, str]]
|
||||
@@ -162,7 +164,9 @@ class AutoField(Field):
|
||||
def to_python(self, value: Union[int, str]) -> int: ...
|
||||
def rel_db_type(self, connection: DatabaseWrapper) -> str: ...
|
||||
def validate(self, value: Any, model_instance: Any) -> None: ...
|
||||
def get_db_prep_value(self, value: Union[int, str], connection: DatabaseWrapper, prepared: bool = ...) -> Union[int, str]: ...
|
||||
def get_db_prep_value(
|
||||
self, value: Union[int, str], connection: DatabaseWrapper, prepared: bool = ...
|
||||
) -> Union[int, str]: ...
|
||||
def get_prep_value(self, value: Optional[Union[int, str]]) -> Optional[int]: ...
|
||||
def contribute_to_class(self, cls: Type[Model], name: str, **kwargs: Any) -> None: ...
|
||||
def formfield(self, **kwargs: Any) -> None: ...
|
||||
@@ -206,7 +210,12 @@ class DateField(DateTimeCheckMixin, Field):
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
def __init__(
|
||||
self, verbose_name: Optional[str] = ..., name: None = ..., auto_now: bool = ..., auto_now_add: bool = ..., **kwargs: Any
|
||||
self,
|
||||
verbose_name: Optional[str] = ...,
|
||||
name: None = ...,
|
||||
auto_now: bool = ...,
|
||||
auto_now_add: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def deconstruct(self) -> Tuple[Optional[str], str, List[Any], Dict[str, Union[Callable, int, str]]]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
@@ -214,7 +223,9 @@ class DateField(DateTimeCheckMixin, Field):
|
||||
def pre_save(self, model_instance: Model, add: bool) -> Optional[Union[date, CombinedExpression]]: ...
|
||||
def contribute_to_class(self, cls: Type[Model], name: str, **kwargs: Any) -> None: ...
|
||||
def get_prep_value(self, value: Optional[Union[date, str]]) -> Optional[date]: ...
|
||||
def get_db_prep_value(self, value: Optional[date], connection: DatabaseWrapper, prepared: bool = ...) -> Optional[str]: ...
|
||||
def get_db_prep_value(
|
||||
self, value: Optional[date], connection: DatabaseWrapper, prepared: bool = ...
|
||||
) -> Optional[str]: ...
|
||||
def value_to_string(self, obj: Model) -> str: ...
|
||||
def formfield(self, **kwargs: Any) -> Field: ...
|
||||
|
||||
@@ -343,7 +354,9 @@ class GenericIPAddressField(Field):
|
||||
def deconstruct(self): ...
|
||||
def get_internal_type(self): ...
|
||||
def to_python(self, value: Union[Callable, int, str]) -> str: ...
|
||||
def get_db_prep_value(self, value: Optional[str], connection: DatabaseWrapper, prepared: bool = ...) -> Optional[str]: ...
|
||||
def get_db_prep_value(
|
||||
self, value: Optional[str], connection: DatabaseWrapper, prepared: bool = ...
|
||||
) -> Optional[str]: ...
|
||||
def get_prep_value(self, value: Optional[str]) -> Optional[str]: ...
|
||||
|
||||
class NullBooleanField(BooleanField):
|
||||
|
||||
@@ -84,7 +84,9 @@ class ImageField(FileField):
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def deconstruct(self) -> Tuple[Optional[str], str, List[Any], Dict[str, Union[Callable, bool, FileSystemStorage, str]]]: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[Optional[str], str, List[Any], Dict[str, Union[Callable, bool, FileSystemStorage, str]]]: ...
|
||||
def contribute_to_class(self, cls: Type[Model], name: str, **kwargs: Any) -> None: ...
|
||||
def update_dimension_fields(self, instance: Model, force: bool = ..., *args: Any, **kwargs: Any) -> None: ...
|
||||
def formfield(self, **kwargs: Any) -> ImageField: ...
|
||||
|
||||
@@ -7,7 +7,16 @@ from django.db.models.base import Model
|
||||
from django.db.models.expressions import Col
|
||||
from django.db.models.fields import Field
|
||||
from django.db.models.fields.related import ForeignObject
|
||||
from django.db.models.lookups import BuiltinLookup, Exact, GreaterThan, GreaterThanOrEqual, In, IsNull, LessThan, LessThanOrEqual
|
||||
from django.db.models.lookups import (
|
||||
BuiltinLookup,
|
||||
Exact,
|
||||
GreaterThan,
|
||||
GreaterThanOrEqual,
|
||||
In,
|
||||
IsNull,
|
||||
LessThan,
|
||||
LessThanOrEqual,
|
||||
)
|
||||
from django.db.models.sql.compiler import SQLCompiler
|
||||
from django.db.models.sql.query import Query
|
||||
|
||||
|
||||
@@ -56,7 +56,9 @@ class ForeignObjectRel(FieldCacheMixin):
|
||||
def get_internal_type(self) -> str: ...
|
||||
@property
|
||||
def db_type(self) -> Callable: ...
|
||||
def get_choices(self, include_blank: bool = ..., blank_choice: List[Tuple[str, str]] = ...) -> List[Tuple[int, str]]: ...
|
||||
def get_choices(
|
||||
self, include_blank: bool = ..., blank_choice: List[Tuple[str, str]] = ...
|
||||
) -> List[Tuple[int, str]]: ...
|
||||
def is_hidden(self) -> bool: ...
|
||||
def get_joining_columns(self) -> Tuple: ...
|
||||
def get_extra_restriction(
|
||||
|
||||
@@ -141,7 +141,9 @@ class TruncBase(TimezoneMixin, Transform):
|
||||
summarize: bool = ...,
|
||||
for_save: bool = ...,
|
||||
) -> TruncBase: ...
|
||||
def convert_value(self, value: datetime, expression: models.functions.TruncBase, connection: DatabaseWrapper) -> datetime: ...
|
||||
def convert_value(
|
||||
self, value: datetime, expression: models.functions.TruncBase, connection: DatabaseWrapper
|
||||
) -> datetime: ...
|
||||
|
||||
class Trunc(TruncBase):
|
||||
contains_aggregate: bool
|
||||
|
||||
@@ -6,7 +6,9 @@ from django.db.models.expressions import Combinable, Expression, Value
|
||||
from django.db.models.sql.compiler import SQLCompiler
|
||||
|
||||
class BytesToCharFieldConversionMixin:
|
||||
def convert_value(self, value: str, expression: BytesToCharFieldConversionMixin, connection: DatabaseWrapper) -> str: ...
|
||||
def convert_value(
|
||||
self, value: str, expression: BytesToCharFieldConversionMixin, connection: DatabaseWrapper
|
||||
) -> str: ...
|
||||
|
||||
class Chr(Transform):
|
||||
contains_aggregate: bool
|
||||
@@ -18,7 +20,9 @@ class Chr(Transform):
|
||||
lookup_name: str = ...
|
||||
def as_mysql(self, compiler: Any, connection: Any): ...
|
||||
def as_oracle(self, compiler: Any, connection: Any): ...
|
||||
def as_sqlite(self, compiler: SQLCompiler, connection: DatabaseWrapper, **extra_context: Any) -> Tuple[str, List[int]]: ...
|
||||
def as_sqlite(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper, **extra_context: Any
|
||||
) -> Tuple[str, List[int]]: ...
|
||||
|
||||
class ConcatPair(Func):
|
||||
contains_aggregate: bool
|
||||
@@ -54,7 +58,9 @@ class Left(Func):
|
||||
arity: int = ...
|
||||
def __init__(self, expression: str, length: Union[Value, int], **extra: Any) -> None: ...
|
||||
def get_substr(self) -> Substr: ...
|
||||
def use_substr(self, compiler: SQLCompiler, connection: DatabaseWrapper, **extra_context: Any) -> Tuple[str, List[int]]: ...
|
||||
def use_substr(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper, **extra_context: Any
|
||||
) -> Tuple[str, List[int]]: ...
|
||||
as_oracle: Any = ...
|
||||
as_sqlite: Any = ...
|
||||
|
||||
@@ -111,7 +117,9 @@ class Ord(Transform):
|
||||
lookup_name: str = ...
|
||||
output_field: Any = ...
|
||||
def as_mysql(self, compiler: Any, connection: Any, **extra_context: Any): ...
|
||||
def as_sqlite(self, compiler: SQLCompiler, connection: DatabaseWrapper, **extra_context: Any) -> Tuple[str, List[Any]]: ...
|
||||
def as_sqlite(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper, **extra_context: Any
|
||||
) -> Tuple[str, List[Any]]: ...
|
||||
|
||||
class Repeat(BytesToCharFieldConversionMixin, Func):
|
||||
contains_aggregate: bool
|
||||
|
||||
@@ -66,7 +66,9 @@ class FieldGetDbPrepValueMixin:
|
||||
class FieldGetDbPrepValueIterableMixin(FieldGetDbPrepValueMixin):
|
||||
get_db_prep_lookup_value_is_iterable: bool = ...
|
||||
def get_prep_lookup(self) -> Iterable[Any]: ...
|
||||
def process_rhs(self, compiler: SQLCompiler, connection: DatabaseWrapper) -> Tuple[Union[Tuple[str, str], str], Tuple]: ...
|
||||
def process_rhs(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[Union[Tuple[str, str], str], Tuple]: ...
|
||||
def resolve_expression_parameter(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper, sql: str, param: Optional[Union[Combinable, int, str]]
|
||||
) -> Tuple[str, List[None]]: ...
|
||||
|
||||
@@ -50,7 +50,9 @@ class Manager(Generic[_T]):
|
||||
def all(self) -> QuerySet[_T]: ...
|
||||
def filter(self, *args: Any, **kwargs: Any) -> QuerySet[_T]: ...
|
||||
def exclude(self, *args: Any, **kwargs: Any) -> QuerySet[_T]: ...
|
||||
def complex_filter(self, filter_obj: Union[Dict[str, datetime], Dict[str, QuerySet], Q, MagicMock]) -> QuerySet[_T]: ...
|
||||
def complex_filter(
|
||||
self, filter_obj: Union[Dict[str, datetime], Dict[str, QuerySet], Q, MagicMock]
|
||||
) -> QuerySet[_T]: ...
|
||||
def union(self, *other_qs: Any, all: bool = ...) -> QuerySet[_T]: ...
|
||||
def intersection(self, *other_qs: Any) -> QuerySet[_T]: ...
|
||||
def difference(self, *other_qs: Any) -> QuerySet[_T]: ...
|
||||
|
||||
@@ -90,7 +90,9 @@ class Options:
|
||||
default_related_name: None = ...
|
||||
def __init__(
|
||||
self,
|
||||
meta: Optional[Type[Union[AbstractBaseUser.Meta, AbstractUser.Meta, PermissionsMixin.Meta, AbstractBaseSession.Meta]]],
|
||||
meta: Optional[
|
||||
Type[Union[AbstractBaseUser.Meta, AbstractUser.Meta, PermissionsMixin.Meta, AbstractBaseSession.Meta]]
|
||||
],
|
||||
app_label: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
@property
|
||||
|
||||
@@ -76,7 +76,10 @@ class QuerySet(Generic[_T]):
|
||||
memo: Dict[
|
||||
int,
|
||||
Union[
|
||||
Dict[str, Union[ModelState, int, str]], List[Union[Dict[str, Union[bool, str]], ModelState]], Model, ModelState
|
||||
Dict[str, Union[ModelState, int, str]],
|
||||
List[Union[Dict[str, Union[bool, str]], ModelState]],
|
||||
Model,
|
||||
ModelState,
|
||||
],
|
||||
],
|
||||
) -> QuerySet[_T]: ...
|
||||
@@ -129,7 +132,9 @@ class QuerySet(Generic[_T]):
|
||||
def all(self) -> QuerySet[_T]: ...
|
||||
def filter(self, *args: Any, **kwargs: Any) -> QuerySet[_T]: ...
|
||||
def exclude(self, *args: Any, **kwargs: Any) -> QuerySet[_T]: ...
|
||||
def complex_filter(self, filter_obj: Union[Dict[str, datetime], Dict[str, QuerySet], Q, MagicMock]) -> QuerySet[_T]: ...
|
||||
def complex_filter(
|
||||
self, filter_obj: Union[Dict[str, datetime], Dict[str, QuerySet], Q, MagicMock]
|
||||
) -> QuerySet[_T]: ...
|
||||
def union(self, *other_qs: Any, all: bool = ...) -> QuerySet[_T]: ...
|
||||
def intersection(self, *other_qs: Any) -> QuerySet[_T]: ...
|
||||
def difference(self, *other_qs: Any) -> QuerySet[_T]: ...
|
||||
@@ -237,7 +242,9 @@ class RelatedPopulator:
|
||||
def populate(
|
||||
self,
|
||||
row: Union[
|
||||
List[Optional[Union[date, int, str]]], List[Union[date, Decimal, float, str]], Tuple[Union[int, str], str, int]
|
||||
List[Optional[Union[date, int, str]]],
|
||||
List[Union[date, Decimal, float, str]],
|
||||
Tuple[Union[int, str], str, int],
|
||||
],
|
||||
from_obj: Model,
|
||||
) -> None: ...
|
||||
|
||||
@@ -60,7 +60,11 @@ class RegisterLookupMixin:
|
||||
def get_transform(self, lookup_name: str) -> Optional[Type[Transform]]: ...
|
||||
@staticmethod
|
||||
def merge_dicts(
|
||||
dicts: List[Dict[str, Type[Union[TimezoneMixin, FieldGetDbPrepValueMixin, IntegerFieldFloatRounding, Lookup, Transform]]]]
|
||||
dicts: List[
|
||||
Dict[
|
||||
str, Type[Union[TimezoneMixin, FieldGetDbPrepValueMixin, IntegerFieldFloatRounding, Lookup, Transform]]
|
||||
]
|
||||
]
|
||||
) -> Dict[str, Type[Union[TimezoneMixin, FieldGetDbPrepValueMixin, Lookup, Transform]]]: ...
|
||||
@classmethod
|
||||
def register_lookup(
|
||||
@@ -70,7 +74,9 @@ class RegisterLookupMixin:
|
||||
def select_related_descend(
|
||||
field: Field,
|
||||
restricted: bool,
|
||||
requested: Optional[Union[Dict[str, Dict[str, Dict[str, Dict[str, Dict[str, Dict[str, Dict[str, Dict[Any, Any]]]]]]]], bool]],
|
||||
requested: Optional[
|
||||
Union[Dict[str, Dict[str, Dict[str, Dict[str, Dict[str, Dict[str, Dict[str, Dict[Any, Any]]]]]]]], bool]
|
||||
],
|
||||
load_fields: Optional[Set[str]],
|
||||
reverse: bool = ...,
|
||||
) -> bool: ...
|
||||
|
||||
@@ -41,7 +41,9 @@ class SQLCompiler:
|
||||
select: List[Tuple[Union[BaseExpression, SQLiteNumericMixin], Tuple[str, List[float]], Optional[str]]],
|
||||
order_by: List[Tuple[OrderBy, Tuple[str, List[Union[int, str]], bool]]],
|
||||
) -> List[Tuple[str, List[float]]]: ...
|
||||
def collapse_group_by(self, expressions: List[Expression], having: Union[List[Expression], Tuple]) -> List[Expression]: ...
|
||||
def collapse_group_by(
|
||||
self, expressions: List[Expression], having: Union[List[Expression], Tuple]
|
||||
) -> List[Expression]: ...
|
||||
def get_select(
|
||||
self
|
||||
) -> Tuple[
|
||||
@@ -56,7 +58,9 @@ class SQLCompiler:
|
||||
select: List[Tuple[Union[Expression, SQLiteNumericMixin], Tuple[str, List[float]], Optional[str]]],
|
||||
) -> List[Tuple[OrderBy, Tuple[str, List[Any]], None]]: ...
|
||||
def quote_name_unless_alias(self, name: str) -> str: ...
|
||||
def compile(self, node: Any, select_format: Any = ...) -> Tuple[str, Union[List[Optional[int]], Tuple[int, int]]]: ...
|
||||
def compile(
|
||||
self, node: Any, select_format: Any = ...
|
||||
) -> Tuple[str, Union[List[Optional[int]], Tuple[int, int]]]: ...
|
||||
def get_combinator_sql(self, combinator: str, all: bool) -> Tuple[List[str], Union[List[int], List[str]]]: ...
|
||||
def as_sql(self, with_limits: bool = ..., with_col_aliases: bool = ...) -> Any: ...
|
||||
def get_default_columns(
|
||||
|
||||
@@ -46,9 +46,13 @@ class RawQuery:
|
||||
class Query:
|
||||
base_table: str
|
||||
related_ids: None
|
||||
related_updates: Dict[Type[django.db.models.base.Model], List[Tuple[django.db.models.fields.Field, None, Union[int, str]]]]
|
||||
related_updates: Dict[
|
||||
Type[django.db.models.base.Model], List[Tuple[django.db.models.fields.Field, None, Union[int, str]]]
|
||||
]
|
||||
values: List[
|
||||
Tuple[django.db.models.fields.Field, Optional[Type[django.db.models.base.Model]], django.db.models.aggregates.Max]
|
||||
Tuple[
|
||||
django.db.models.fields.Field, Optional[Type[django.db.models.base.Model]], django.db.models.aggregates.Max
|
||||
]
|
||||
]
|
||||
alias_prefix: str = ...
|
||||
subq_aliases: frozenset = ...
|
||||
@@ -75,7 +79,9 @@ class Query:
|
||||
select_for_update_nowait: bool = ...
|
||||
select_for_update_skip_locked: bool = ...
|
||||
select_for_update_of: Tuple = ...
|
||||
select_related: Union[Dict[str, Dict[str, Dict[str, Dict[str, Dict[str, Dict[str, Dict[str, Dict[Any, Any]]]]]]]], bool] = ...
|
||||
select_related: Union[
|
||||
Dict[str, Dict[str, Dict[str, Dict[str, Dict[str, Dict[str, Dict[str, Dict[Any, Any]]]]]]]], bool
|
||||
] = ...
|
||||
max_depth: int = ...
|
||||
values_select: Tuple = ...
|
||||
annotation_select_mask: Optional[Set[str]] = ...
|
||||
@@ -103,7 +109,10 @@ class Query:
|
||||
memo: Dict[
|
||||
int,
|
||||
Union[
|
||||
Dict[str, Union[ModelState, int, str]], List[Union[Dict[str, Union[bool, str]], ModelState]], Model, ModelState
|
||||
Dict[str, Union[ModelState, int, str]],
|
||||
List[Union[Dict[str, Union[bool, str]], ModelState]],
|
||||
Model,
|
||||
ModelState,
|
||||
],
|
||||
],
|
||||
) -> Query: ...
|
||||
@@ -146,10 +155,18 @@ class Query:
|
||||
def resolve_expression(self, query: Query, *args: Any, **kwargs: Any) -> Query: ...
|
||||
def as_sql(self, compiler: SQLCompiler, connection: DatabaseWrapper) -> Tuple[str, Tuple]: ...
|
||||
def resolve_lookup_value(self, value: Any, can_reuse: Optional[Set[str]], allow_joins: bool) -> Any: ...
|
||||
def solve_lookup_type(self, lookup: str) -> Union[Tuple[List[str], List[str], bool], Tuple[List[str], Tuple, Expression]]: ...
|
||||
def check_query_object_type(self, value: Union[Model, int, str, UUID], opts: Options, field: FieldCacheMixin) -> None: ...
|
||||
def check_related_objects(self, field: Union[Field, reverse_related.ForeignObjectRel], value: Any, opts: Options) -> None: ...
|
||||
def build_lookup(self, lookups: List[str], lhs: Union[Expression, TextField, MultiColSource], rhs: Any) -> Lookup: ...
|
||||
def solve_lookup_type(
|
||||
self, lookup: str
|
||||
) -> Union[Tuple[List[str], List[str], bool], Tuple[List[str], Tuple, Expression]]: ...
|
||||
def check_query_object_type(
|
||||
self, value: Union[Model, int, str, UUID], opts: Options, field: FieldCacheMixin
|
||||
) -> None: ...
|
||||
def check_related_objects(
|
||||
self, field: Union[Field, reverse_related.ForeignObjectRel], value: Any, opts: Options
|
||||
) -> None: ...
|
||||
def build_lookup(
|
||||
self, lookups: List[str], lhs: Union[Expression, TextField, MultiColSource], rhs: Any
|
||||
) -> Lookup: ...
|
||||
def try_transform(self, lhs: Expression, name: str) -> Transform: ...
|
||||
def build_filter(
|
||||
self,
|
||||
|
||||
@@ -82,7 +82,9 @@ class UpdateQuery(Query):
|
||||
model: Type[django.db.models.base.Model]
|
||||
order_by: Tuple
|
||||
related_ids: Optional[List[int]]
|
||||
related_updates: Dict[Type[django.db.models.base.Model], List[Tuple[django.db.models.fields.Field, None, Union[int, str]]]]
|
||||
related_updates: Dict[
|
||||
Type[django.db.models.base.Model], List[Tuple[django.db.models.fields.Field, None, Union[int, str]]]
|
||||
]
|
||||
select: Tuple
|
||||
select_for_update: bool
|
||||
select_for_update_nowait: bool
|
||||
|
||||
@@ -39,7 +39,9 @@ class WhereNode(tree.Node):
|
||||
|
||||
class NothingNode:
|
||||
contains_aggregate: bool = ...
|
||||
def as_sql(self, compiler: SQLCompiler = ..., connection: Union[DefaultConnectionProxy, DatabaseWrapper] = ...) -> Any: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler = ..., connection: Union[DefaultConnectionProxy, DatabaseWrapper] = ...
|
||||
) -> Any: ...
|
||||
|
||||
class ExtraWhere:
|
||||
contains_aggregate: bool = ...
|
||||
|
||||
@@ -33,7 +33,9 @@ class ConnectionDoesNotExist(Exception): ...
|
||||
class ConnectionHandler:
|
||||
databases: Dict[str, Dict[str, Optional[Union[Dict[str, Optional[bool]], int, str]]]]
|
||||
def __init__(self, databases: Dict[str, Dict[str, Union[Dict[str, str], str]]] = ...) -> None: ...
|
||||
def databases(self) -> Dict[str, Union[Dict[str, Union[Dict[str, bool], str]], Dict[str, Union[Dict[str, str], str]]]]: ...
|
||||
def databases(
|
||||
self
|
||||
) -> Dict[str, Union[Dict[str, Union[Dict[str, bool], str]], Dict[str, Union[Dict[str, str], str]]]]: ...
|
||||
def ensure_defaults(self, alias: str) -> None: ...
|
||||
def prepare_test_settings(self, alias: str) -> None: ...
|
||||
def __getitem__(self, alias: str) -> BaseDatabaseWrapper: ...
|
||||
@@ -52,4 +54,6 @@ class ConnectionRouter:
|
||||
def allow_relation(self, obj1: Model, obj2: Model, **hints: Any) -> bool: ...
|
||||
def allow_migrate(self, db: str, app_label: str, **hints: Any) -> bool: ...
|
||||
def allow_migrate_model(self, db: str, model: Type[Model]) -> bool: ...
|
||||
def get_migratable_models(self, app_config: AppConfig, db: str, include_auto_created: bool = ...) -> List[Type[Model]]: ...
|
||||
def get_migratable_models(
|
||||
self, app_config: AppConfig, db: str, include_auto_created: bool = ...
|
||||
) -> List[Type[Model]]: ...
|
||||
|
||||
Reference in New Issue
Block a user