mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-08 21:14:49 +08:00
move generated stubs to separate directory, too messty
This commit is contained in:
26
django-stubs-generated/db/__init__.pyi
Normal file
26
django-stubs-generated/db/__init__.pyi
Normal file
@@ -0,0 +1,26 @@
|
||||
from typing import Any, Optional, Union
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.utils import DEFAULT_DB_ALIAS as DEFAULT_DB_ALIAS
|
||||
from django.db.utils import \
|
||||
DJANGO_VERSION_PICKLE_KEY as DJANGO_VERSION_PICKLE_KEY
|
||||
from django.db.utils import DatabaseError as DatabaseError
|
||||
from django.db.utils import DataError as DataError
|
||||
from django.db.utils import Error as Error
|
||||
from django.db.utils import IntegrityError as IntegrityError
|
||||
from django.db.utils import InterfaceError as InterfaceError
|
||||
from django.db.utils import InternalError as InternalError
|
||||
from django.db.utils import NotSupportedError as NotSupportedError
|
||||
from django.db.utils import OperationalError as OperationalError
|
||||
from django.db.utils import ProgrammingError as ProgrammingError
|
||||
|
||||
connections: Any
|
||||
router: Any
|
||||
|
||||
class DefaultConnectionProxy:
|
||||
def __getattr__(self, item: str) -> Any: ...
|
||||
def __setattr__(self, name: str, value: Union[bool, MagicMock]) -> None: ...
|
||||
def __delattr__(self, name: str) -> None: ...
|
||||
|
||||
connection: Any
|
||||
0
django-stubs-generated/db/backends/__init__.pyi
Normal file
0
django-stubs-generated/db/backends/__init__.pyi
Normal file
110
django-stubs-generated/db/backends/base/base.pyi
Normal file
110
django-stubs-generated/db/backends/base/base.pyi
Normal file
@@ -0,0 +1,110 @@
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional
|
||||
|
||||
from django.db.backends.sqlite3.base import (DatabaseWrapper,
|
||||
SQLiteCursorWrapper)
|
||||
from django.db.backends.sqlite3.schema import DatabaseSchemaEditor
|
||||
from django.db.backends.utils import CursorDebugWrapper, CursorWrapper
|
||||
from django.db.utils import DatabaseErrorWrapper
|
||||
|
||||
NO_DB_ALIAS: str
|
||||
|
||||
class BaseDatabaseWrapper:
|
||||
data_types: Any = ...
|
||||
data_types_suffix: Any = ...
|
||||
data_type_check_constraints: Any = ...
|
||||
ops: Any = ...
|
||||
vendor: str = ...
|
||||
display_name: str = ...
|
||||
SchemaEditorClass: Any = ...
|
||||
client_class: Any = ...
|
||||
creation_class: Any = ...
|
||||
features_class: Any = ...
|
||||
introspection_class: Any = ...
|
||||
ops_class: Any = ...
|
||||
validation_class: Any = ...
|
||||
queries_limit: int = ...
|
||||
connection: Any = ...
|
||||
settings_dict: Any = ...
|
||||
alias: Any = ...
|
||||
queries_log: Any = ...
|
||||
force_debug_cursor: bool = ...
|
||||
autocommit: bool = ...
|
||||
in_atomic_block: bool = ...
|
||||
savepoint_state: int = ...
|
||||
savepoint_ids: Any = ...
|
||||
commit_on_exit: bool = ...
|
||||
needs_rollback: bool = ...
|
||||
close_at: Any = ...
|
||||
closed_in_transaction: bool = ...
|
||||
errors_occurred: bool = ...
|
||||
allow_thread_sharing: Any = ...
|
||||
run_on_commit: Any = ...
|
||||
run_commit_hooks_on_set_autocommit_on: bool = ...
|
||||
execute_wrappers: Any = ...
|
||||
client: Any = ...
|
||||
creation: Any = ...
|
||||
features: Any = ...
|
||||
introspection: Any = ...
|
||||
validation: Any = ...
|
||||
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): ...
|
||||
@property
|
||||
def queries_logged(self) -> bool: ...
|
||||
@property
|
||||
def queries(self) -> List[Dict[str, str]]: ...
|
||||
def get_connection_params(self) -> None: ...
|
||||
def get_new_connection(self, conn_params: Any) -> None: ...
|
||||
def init_connection_state(self) -> None: ...
|
||||
def create_cursor(self, name: Optional[Any] = ...) -> None: ...
|
||||
def connect(self) -> None: ...
|
||||
def check_settings(self) -> None: ...
|
||||
def ensure_connection(self) -> None: ...
|
||||
def cursor(self) -> CursorWrapper: ...
|
||||
def commit(self) -> None: ...
|
||||
def rollback(self) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def savepoint(self) -> str: ...
|
||||
def savepoint_rollback(self, sid: str) -> None: ...
|
||||
def savepoint_commit(self, sid: str) -> None: ...
|
||||
def clean_savepoints(self) -> None: ...
|
||||
def get_autocommit(self) -> bool: ...
|
||||
def set_autocommit(
|
||||
self,
|
||||
autocommit: bool,
|
||||
force_begin_transaction_with_broken_autocommit: bool = ...,
|
||||
) -> None: ...
|
||||
def get_rollback(self) -> bool: ...
|
||||
def set_rollback(self, rollback: bool) -> None: ...
|
||||
def validate_no_atomic_block(self) -> None: ...
|
||||
def validate_no_broken_transaction(self) -> None: ...
|
||||
def constraint_checks_disabled(self) -> Iterator[None]: ...
|
||||
def disable_constraint_checking(self): ...
|
||||
def enable_constraint_checking(self) -> None: ...
|
||||
def check_constraints(self, table_names: Optional[Any] = ...) -> None: ...
|
||||
def is_usable(self) -> None: ...
|
||||
def close_if_unusable_or_obsolete(self) -> None: ...
|
||||
def validate_thread_sharing(self) -> None: ...
|
||||
def prepare_database(self) -> None: ...
|
||||
def wrap_database_errors(self) -> DatabaseErrorWrapper: ...
|
||||
def chunked_cursor(self) -> CursorWrapper: ...
|
||||
def make_debug_cursor(
|
||||
self, cursor: SQLiteCursorWrapper
|
||||
) -> CursorDebugWrapper: ...
|
||||
def make_cursor(self, cursor: SQLiteCursorWrapper) -> CursorWrapper: ...
|
||||
def temporary_connection(self) -> None: ...
|
||||
def schema_editor(
|
||||
self, *args: Any, **kwargs: Any
|
||||
) -> DatabaseSchemaEditor: ...
|
||||
def on_commit(self, func: Callable) -> None: ...
|
||||
def run_and_clear_commit_hooks(self) -> None: ...
|
||||
def execute_wrapper(self, wrapper: Callable) -> Iterator[None]: ...
|
||||
def copy(
|
||||
self, alias: None = ..., allow_thread_sharing: None = ...
|
||||
) -> DatabaseWrapper: ...
|
||||
10
django-stubs-generated/db/backends/base/client.pyi
Normal file
10
django-stubs-generated/db/backends/base/client.pyi
Normal file
@@ -0,0 +1,10 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||
|
||||
|
||||
class BaseDatabaseClient:
|
||||
executable_name: Any = ...
|
||||
connection: Any = ...
|
||||
def __init__(self, connection: BaseDatabaseWrapper) -> None: ...
|
||||
def runshell(self) -> None: ...
|
||||
41
django-stubs-generated/db/backends/base/creation.pyi
Normal file
41
django-stubs-generated/db/backends/base/creation.pyi
Normal file
@@ -0,0 +1,41 @@
|
||||
from typing import Any, Dict, Optional, Tuple, Union
|
||||
|
||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||
|
||||
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 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: ...
|
||||
def get_test_db_clone_settings(self, suffix: Any): ...
|
||||
def destroy_test_db(
|
||||
self,
|
||||
old_database_name: str = ...,
|
||||
verbosity: int = ...,
|
||||
keepdb: bool = ...,
|
||||
suffix: None = ...,
|
||||
) -> None: ...
|
||||
def sql_table_creation_suffix(self): ...
|
||||
def test_db_signature(self) -> Tuple[str, str, str, str]: ...
|
||||
101
django-stubs-generated/db/backends/base/features.pyi
Normal file
101
django-stubs-generated/db/backends/base/features.pyi
Normal file
@@ -0,0 +1,101 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||
|
||||
|
||||
class BaseDatabaseFeatures:
|
||||
gis_enabled: bool = ...
|
||||
allows_group_by_pk: bool = ...
|
||||
allows_group_by_selected_pks: bool = ...
|
||||
empty_fetchmany_value: Any = ...
|
||||
update_can_self_select: bool = ...
|
||||
interprets_empty_strings_as_nulls: bool = ...
|
||||
supports_nullable_unique_constraints: bool = ...
|
||||
supports_partially_nullable_unique_constraints: bool = ...
|
||||
can_use_chunked_reads: bool = ...
|
||||
can_return_id_from_insert: bool = ...
|
||||
can_return_ids_from_bulk_insert: bool = ...
|
||||
has_bulk_insert: bool = ...
|
||||
uses_savepoints: bool = ...
|
||||
can_release_savepoints: bool = ...
|
||||
related_fields_match_type: bool = ...
|
||||
allow_sliced_subqueries_with_in: bool = ...
|
||||
has_select_for_update: bool = ...
|
||||
has_select_for_update_nowait: bool = ...
|
||||
has_select_for_update_skip_locked: bool = ...
|
||||
has_select_for_update_of: bool = ...
|
||||
select_for_update_of_column: bool = ...
|
||||
test_db_allows_multiple_connections: bool = ...
|
||||
supports_unspecified_pk: bool = ...
|
||||
supports_forward_references: bool = ...
|
||||
truncates_names: bool = ...
|
||||
has_real_datatype: bool = ...
|
||||
supports_subqueries_in_group_by: bool = ...
|
||||
has_native_uuid_field: bool = ...
|
||||
has_native_duration_field: bool = ...
|
||||
supports_temporal_subtraction: bool = ...
|
||||
supports_regex_backreferencing: bool = ...
|
||||
supports_date_lookup_using_string: bool = ...
|
||||
supports_timezones: bool = ...
|
||||
has_zoneinfo_database: bool = ...
|
||||
requires_explicit_null_ordering_when_grouping: bool = ...
|
||||
nulls_order_largest: bool = ...
|
||||
max_query_params: Any = ...
|
||||
allows_auto_pk_0: bool = ...
|
||||
can_defer_constraint_checks: bool = ...
|
||||
supports_mixed_date_datetime_comparisons: bool = ...
|
||||
supports_tablespaces: bool = ...
|
||||
supports_sequence_reset: bool = ...
|
||||
can_introspect_default: bool = ...
|
||||
can_introspect_foreign_keys: bool = ...
|
||||
can_introspect_autofield: bool = ...
|
||||
can_introspect_big_integer_field: bool = ...
|
||||
can_introspect_binary_field: bool = ...
|
||||
can_introspect_decimal_field: bool = ...
|
||||
can_introspect_ip_address_field: bool = ...
|
||||
can_introspect_positive_integer_field: bool = ...
|
||||
can_introspect_small_integer_field: bool = ...
|
||||
can_introspect_time_field: bool = ...
|
||||
introspected_boolean_field_type: str = ...
|
||||
supports_index_column_ordering: bool = ...
|
||||
can_distinct_on_fields: bool = ...
|
||||
autocommits_when_autocommit_is_off: bool = ...
|
||||
atomic_transactions: bool = ...
|
||||
can_rollback_ddl: bool = ...
|
||||
supports_atomic_references_rename: bool = ...
|
||||
supports_combined_alters: bool = ...
|
||||
supports_foreign_keys: bool = ...
|
||||
supports_column_check_constraints: bool = ...
|
||||
supports_paramstyle_pyformat: bool = ...
|
||||
requires_literal_defaults: bool = ...
|
||||
connection_persists_old_columns: bool = ...
|
||||
closed_cursor_error_class: Any = ...
|
||||
has_case_insensitive_like: bool = ...
|
||||
requires_sqlparse_for_splitting: bool = ...
|
||||
bare_select_suffix: str = ...
|
||||
implied_column_null: bool = ...
|
||||
uppercases_column_names: bool = ...
|
||||
supports_select_for_update_with_limit: bool = ...
|
||||
greatest_least_ignores_nulls: bool = ...
|
||||
can_clone_databases: bool = ...
|
||||
ignores_table_name_case: bool = ...
|
||||
for_update_after_from: bool = ...
|
||||
supports_select_union: bool = ...
|
||||
supports_select_intersection: bool = ...
|
||||
supports_select_difference: bool = ...
|
||||
supports_slicing_ordering_in_compound: bool = ...
|
||||
supports_aggregate_filter_clause: bool = ...
|
||||
supports_index_on_text_field: bool = ...
|
||||
supports_over_clause: bool = ...
|
||||
supports_cast_with_precision: bool = ...
|
||||
create_test_procedure_without_params_sql: Any = ...
|
||||
create_test_procedure_with_int_param_sql: Any = ...
|
||||
supports_callproc_kwargs: bool = ...
|
||||
db_functions_convert_bytes_to_str: bool = ...
|
||||
supported_explain_formats: Any = ...
|
||||
validates_explain_options: bool = ...
|
||||
connection: Any = ...
|
||||
def __init__(self, connection: BaseDatabaseWrapper) -> None: ...
|
||||
def supports_explaining_query_execution(self) -> bool: ...
|
||||
def supports_transactions(self): ...
|
||||
def supports_stddev(self): ...
|
||||
38
django-stubs-generated/db/backends/base/introspection.pyi
Normal file
38
django-stubs-generated/db/backends/base/introspection.pyi
Normal file
@@ -0,0 +1,38 @@
|
||||
from collections import namedtuple
|
||||
from typing import Any, Dict, List, Optional, Set, Tuple, Type, Union
|
||||
|
||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||
from django.db.backends.utils import CursorWrapper
|
||||
from django.db.models.base import Model
|
||||
|
||||
TableInfo = namedtuple("TableInfo", ["name", "type"])
|
||||
|
||||
FieldInfo = namedtuple(
|
||||
"FieldInfo",
|
||||
"name type_code display_size internal_size precision scale null_ok default",
|
||||
)
|
||||
|
||||
class BaseDatabaseIntrospection:
|
||||
data_types_reverse: Any = ...
|
||||
connection: Any = ...
|
||||
def __init__(self, connection: BaseDatabaseWrapper) -> None: ...
|
||||
def get_field_type(
|
||||
self, data_type: str, description: FieldInfo
|
||||
) -> Union[Tuple[str, Dict[str, int]], str]: ...
|
||||
def table_name_converter(self, name: str) -> str: ...
|
||||
def column_name_converter(self, name: str) -> str: ...
|
||||
def table_names(
|
||||
self, cursor: Optional[CursorWrapper] = ..., include_views: bool = ...
|
||||
) -> List[str]: ...
|
||||
def get_table_list(self, cursor: Any) -> None: ...
|
||||
def django_table_names(
|
||||
self, only_existing: bool = ..., include_views: bool = ...
|
||||
) -> List[str]: ...
|
||||
def installed_models(self, tables: List[str]) -> Set[Type[Model]]: ...
|
||||
def sequence_list(self) -> List[Dict[str, str]]: ...
|
||||
def get_sequences(
|
||||
self, cursor: Any, table_name: Any, table_fields: Any = ...
|
||||
) -> None: ...
|
||||
def get_key_columns(self, cursor: Any, table_name: Any) -> None: ...
|
||||
def get_primary_key_column(self, cursor: Any, table_name: Any): ...
|
||||
def get_constraints(self, cursor: Any, table_name: Any) -> None: ...
|
||||
163
django-stubs-generated/db/backends/base/operations.pyi
Normal file
163
django-stubs-generated/db/backends/base/operations.pyi
Normal file
@@ -0,0 +1,163 @@
|
||||
from datetime import date, datetime, timedelta
|
||||
from decimal import Decimal
|
||||
from typing import Any, List, Optional, Set, Tuple, Type, Union, Sequence
|
||||
|
||||
from django.core.management.color import Style
|
||||
from django.db import DefaultConnectionProxy
|
||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.backends.utils import CursorWrapper
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.expressions import Case, Expression
|
||||
from django.db.models.fields import Field
|
||||
from django.db.models.sql.compiler import SQLCompiler
|
||||
|
||||
|
||||
class BaseDatabaseOperations:
|
||||
compiler_module: str = ...
|
||||
integer_field_ranges: Any = ...
|
||||
set_operators: Any = ...
|
||||
cast_data_types: Any = ...
|
||||
cast_char_field_without_max_length: Any = ...
|
||||
PRECEDING: str = ...
|
||||
FOLLOWING: str = ...
|
||||
UNBOUNDED_PRECEDING: Any = ...
|
||||
UNBOUNDED_FOLLOWING: Any = ...
|
||||
CURRENT_ROW: str = ...
|
||||
explain_prefix: Any = ...
|
||||
connection: django.db.DefaultConnectionProxy = ...
|
||||
def __init__(
|
||||
self, connection: Union[DefaultConnectionProxy, BaseDatabaseWrapper]
|
||||
) -> None: ...
|
||||
def autoinc_sql(self, table: str, column: str) -> None: ...
|
||||
def bulk_batch_size(self, fields: Any, objs: Any): ...
|
||||
def cache_key_culling_sql(self) -> str: ...
|
||||
def unification_cast_sql(self, output_field: Field) -> str: ...
|
||||
def date_extract_sql(self, lookup_type: None, field_name: None) -> Any: ...
|
||||
def date_interval_sql(self, timedelta: None) -> Any: ...
|
||||
def date_trunc_sql(self, lookup_type: None, field_name: None) -> Any: ...
|
||||
def datetime_cast_date_sql(self, field_name: None, tzname: None) -> Any: ...
|
||||
def datetime_cast_time_sql(self, field_name: None, tzname: None) -> Any: ...
|
||||
def datetime_extract_sql(
|
||||
self, lookup_type: None, field_name: None, tzname: None
|
||||
) -> Any: ...
|
||||
def datetime_trunc_sql(
|
||||
self, lookup_type: None, field_name: None, tzname: None
|
||||
) -> Any: ...
|
||||
def time_trunc_sql(self, lookup_type: None, field_name: None) -> Any: ...
|
||||
def time_extract_sql(self, lookup_type: None, field_name: None) -> Any: ...
|
||||
def deferrable_sql(self) -> str: ...
|
||||
def distinct_sql(
|
||||
self, fields: List[str], params: Optional[List[Any]]
|
||||
) -> Tuple[List[str], List[Any]]: ...
|
||||
def fetch_returned_insert_id(self, cursor: Any): ...
|
||||
def field_cast_sql(
|
||||
self, db_type: Optional[str], internal_type: str
|
||||
) -> str: ...
|
||||
def force_no_ordering(self) -> List[Any]: ...
|
||||
def for_update_sql(
|
||||
self, nowait: bool = ..., skip_locked: bool = ..., of: Any = ...
|
||||
): ...
|
||||
def limit_offset_sql(
|
||||
self, low_mark: int, high_mark: Optional[int]
|
||||
) -> str: ...
|
||||
def last_executed_query(self, cursor: Any, sql: Any, params: Any): ...
|
||||
def last_insert_id(
|
||||
self, cursor: CursorWrapper, table_name: str, pk_name: str
|
||||
) -> int: ...
|
||||
def lookup_cast(
|
||||
self, lookup_type: str, internal_type: str = ...
|
||||
) -> str: ...
|
||||
def max_in_list_size(self) -> None: ...
|
||||
def max_name_length(self) -> None: ...
|
||||
def no_limit_value(self) -> Any: ...
|
||||
def pk_default_value(self) -> str: ...
|
||||
def prepare_sql_script(self, sql: Any): ...
|
||||
def process_clob(self, value: str) -> str: ...
|
||||
def return_insert_id(self) -> None: ...
|
||||
def compiler(self, compiler_name: str) -> Type[SQLCompiler]: ...
|
||||
def quote_name(self, name: str) -> Any: ...
|
||||
def random_function_sql(self): ...
|
||||
def regex_lookup(self, lookup_type: str) -> Any: ...
|
||||
def savepoint_create_sql(self, sid: str) -> str: ...
|
||||
def savepoint_commit_sql(self, sid: str) -> str: ...
|
||||
def savepoint_rollback_sql(self, sid: str) -> str: ...
|
||||
def set_time_zone_sql(self) -> str: ...
|
||||
def sql_flush(
|
||||
self,
|
||||
style: None,
|
||||
tables: None,
|
||||
sequences: None,
|
||||
allow_cascade: bool = ...,
|
||||
) -> Any: ...
|
||||
def execute_sql_flush(self, using: str, sql_list: List[str]) -> None: ...
|
||||
def sequence_reset_by_name_sql(
|
||||
self, style: None, sequences: List[Any]
|
||||
) -> List[Any]: ...
|
||||
def sequence_reset_sql(
|
||||
self,
|
||||
style: Style,
|
||||
model_list: Sequence[Type[Model]],
|
||||
) -> List[Any]: ...
|
||||
def start_transaction_sql(self) -> str: ...
|
||||
def end_transaction_sql(self, success: bool = ...) -> str: ...
|
||||
def tablespace_sql(
|
||||
self, tablespace: Optional[str], inline: bool = ...
|
||||
) -> str: ...
|
||||
def prep_for_like_query(self, x: str) -> str: ...
|
||||
prep_for_iexact_query: Any = ...
|
||||
def validate_autopk_value(self, value: int) -> int: ...
|
||||
def adapt_unknown_value(
|
||||
self, value: Union[datetime, Decimal, int, str]
|
||||
) -> Union[int, str]: ...
|
||||
def adapt_datefield_value(self, value: Optional[date]) -> Optional[str]: ...
|
||||
def adapt_datetimefield_value(self, value: None) -> None: ...
|
||||
def adapt_timefield_value(
|
||||
self, value: Optional[datetime]
|
||||
) -> Optional[str]: ...
|
||||
def adapt_decimalfield_value(
|
||||
self,
|
||||
value: Optional[Decimal],
|
||||
max_digits: Optional[int] = ...,
|
||||
decimal_places: Optional[int] = ...,
|
||||
) -> Optional[str]: ...
|
||||
def adapt_ipaddressfield_value(
|
||||
self, value: Optional[str]
|
||||
) -> Optional[str]: ...
|
||||
def year_lookup_bounds_for_date_field(self, value: int) -> List[str]: ...
|
||||
def year_lookup_bounds_for_datetime_field(
|
||||
self, value: int
|
||||
) -> List[str]: ...
|
||||
def get_db_converters(self, expression: Expression) -> List[Any]: ...
|
||||
def convert_durationfield_value(
|
||||
self,
|
||||
value: Optional[float],
|
||||
expression: Expression,
|
||||
connection: DatabaseWrapper,
|
||||
) -> Optional[timedelta]: ...
|
||||
def check_expression_support(self, expression: Any) -> None: ...
|
||||
def combine_expression(
|
||||
self, connector: str, sub_expressions: List[str]
|
||||
) -> str: ...
|
||||
def combine_duration_expression(
|
||||
self, connector: Any, sub_expressions: Any
|
||||
): ...
|
||||
def binary_placeholder_sql(self, value: Optional[Case]) -> str: ...
|
||||
def modify_insert_params(
|
||||
self,
|
||||
placeholder: str,
|
||||
params: Union[List[None], List[bool], List[float], List[str]],
|
||||
) -> Union[List[None], List[bool], List[float], List[str]]: ...
|
||||
def integer_field_range(self, internal_type: Any): ...
|
||||
def subtract_temporals(self, internal_type: Any, lhs: Any, rhs: Any): ...
|
||||
def window_frame_start(self, start: Any): ...
|
||||
def window_frame_end(self, end: Any): ...
|
||||
def window_frame_rows_start_end(
|
||||
self, start: None = ..., end: None = ...
|
||||
) -> Any: ...
|
||||
def window_frame_range_start_end(
|
||||
self, start: Optional[Any] = ..., end: Optional[Any] = ...
|
||||
): ...
|
||||
def explain_query_prefix(
|
||||
self, format: Optional[str] = ..., **options: Any
|
||||
) -> str: ...
|
||||
101
django-stubs-generated/db/backends/base/schema.pyi
Normal file
101
django-stubs-generated/db/backends/base/schema.pyi
Normal file
@@ -0,0 +1,101 @@
|
||||
from typing import Any, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.db.backends.ddl_references import Statement
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.backends.sqlite3.schema import DatabaseSchemaEditor
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.fields import Field
|
||||
from django.db.models.indexes import Index
|
||||
|
||||
logger: Any
|
||||
|
||||
class BaseDatabaseSchemaEditor:
|
||||
sql_create_table: str = ...
|
||||
sql_rename_table: str = ...
|
||||
sql_retablespace_table: str = ...
|
||||
sql_delete_table: str = ...
|
||||
sql_create_column: str = ...
|
||||
sql_alter_column: str = ...
|
||||
sql_alter_column_type: str = ...
|
||||
sql_alter_column_null: str = ...
|
||||
sql_alter_column_not_null: str = ...
|
||||
sql_alter_column_default: str = ...
|
||||
sql_alter_column_no_default: str = ...
|
||||
sql_delete_column: str = ...
|
||||
sql_rename_column: str = ...
|
||||
sql_update_with_default: str = ...
|
||||
sql_create_check: str = ...
|
||||
sql_delete_check: str = ...
|
||||
sql_create_unique: str = ...
|
||||
sql_delete_unique: str = ...
|
||||
sql_create_fk: str = ...
|
||||
sql_create_inline_fk: Any = ...
|
||||
sql_delete_fk: str = ...
|
||||
sql_create_index: str = ...
|
||||
sql_delete_index: str = ...
|
||||
sql_create_pk: str = ...
|
||||
sql_delete_pk: str = ...
|
||||
sql_delete_procedure: str = ...
|
||||
connection: Any = ...
|
||||
collect_sql: Any = ...
|
||||
collected_sql: Any = ...
|
||||
atomic_migration: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
connection: DatabaseWrapper,
|
||||
collect_sql: bool = ...,
|
||||
atomic: bool = ...,
|
||||
) -> None: ...
|
||||
deferred_sql: Any = ...
|
||||
atomic: Any = ...
|
||||
def __enter__(self) -> DatabaseSchemaEditor: ...
|
||||
def __exit__(
|
||||
self, exc_type: None, exc_value: None, traceback: None
|
||||
) -> None: ...
|
||||
def execute(
|
||||
self,
|
||||
sql: Union[Statement, str],
|
||||
params: Optional[Union[List[int], Tuple]] = ...,
|
||||
) -> None: ...
|
||||
def quote_name(self, name: str) -> str: ...
|
||||
def column_sql(
|
||||
self, model: Type[Model], field: Field, include_default: bool = ...
|
||||
) -> Union[Tuple[None, None], Tuple[str, List[Any]]]: ...
|
||||
def skip_default(self, field: Any): ...
|
||||
def prepare_default(self, value: Any) -> None: ...
|
||||
def effective_default(self, field: Field) -> Optional[Union[int, str]]: ...
|
||||
def quote_value(self, value: Any) -> None: ...
|
||||
def create_model(self, model: Type[Model]) -> None: ...
|
||||
def delete_model(self, model: Type[Model]) -> None: ...
|
||||
def add_index(self, model: Type[Model], index: Index) -> None: ...
|
||||
def remove_index(self, model: Type[Model], index: Index) -> None: ...
|
||||
def alter_unique_together(
|
||||
self,
|
||||
model: Type[Model],
|
||||
old_unique_together: Union[List[List[str]], Tuple[Tuple[str, str]]],
|
||||
new_unique_together: Union[List[List[str]], Tuple[Tuple[str, str]]],
|
||||
) -> None: ...
|
||||
def alter_index_together(
|
||||
self,
|
||||
model: Type[Model],
|
||||
old_index_together: Union[List[List[str]], List[Tuple[str, str]]],
|
||||
new_index_together: Union[List[List[str]], List[Tuple[str, str]]],
|
||||
) -> None: ...
|
||||
def alter_db_table(
|
||||
self, model: Type[Model], old_db_table: str, new_db_table: str
|
||||
) -> None: ...
|
||||
def alter_db_tablespace(
|
||||
self, model: Any, old_db_tablespace: Any, new_db_tablespace: Any
|
||||
) -> None: ...
|
||||
def add_field(self, model: Any, field: Any): ...
|
||||
def remove_field(self, model: Any, field: Any): ...
|
||||
def alter_field(
|
||||
self,
|
||||
model: Type[Model],
|
||||
old_field: Field,
|
||||
new_field: Field,
|
||||
strict: bool = ...,
|
||||
) -> None: ...
|
||||
def remove_procedure(
|
||||
self, procedure_name: Any, param_types: Any = ...
|
||||
) -> None: ...
|
||||
11
django-stubs-generated/db/backends/base/validation.pyi
Normal file
11
django-stubs-generated/db/backends/base/validation.pyi
Normal file
@@ -0,0 +1,11 @@
|
||||
from typing import Any, List, Optional
|
||||
|
||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||
from django.db.models.fields import Field
|
||||
|
||||
|
||||
class BaseDatabaseValidation:
|
||||
connection: django.db.backends.sqlite3.base.DatabaseWrapper = ...
|
||||
def __init__(self, connection: BaseDatabaseWrapper) -> None: ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def check_field(self, field: Field, **kwargs: Any) -> List[Any]: ...
|
||||
93
django-stubs-generated/db/backends/ddl_references.pyi
Normal file
93
django-stubs-generated/db/backends/ddl_references.pyi
Normal file
@@ -0,0 +1,93 @@
|
||||
from typing import Any, Callable, List, Tuple, Union, Dict
|
||||
|
||||
|
||||
class Reference:
|
||||
def references_table(self, table: Any): ...
|
||||
def references_column(self, table: Any, column: Any): ...
|
||||
def rename_table_references(
|
||||
self, old_table: Any, new_table: Any
|
||||
) -> None: ...
|
||||
def rename_column_references(
|
||||
self, table: Any, old_column: Any, new_column: Any
|
||||
) -> None: ...
|
||||
|
||||
class Table(Reference):
|
||||
table: str = ...
|
||||
quote_name: Callable = ...
|
||||
def __init__(self, table: str, quote_name: Callable) -> None: ...
|
||||
def references_table(self, table: str) -> bool: ...
|
||||
def rename_table_references(
|
||||
self, old_table: str, new_table: str
|
||||
) -> None: ...
|
||||
|
||||
class TableColumns(Table):
|
||||
table: str = ...
|
||||
columns: List[str] = ...
|
||||
def __init__(self, table: str, columns: List[str]) -> None: ...
|
||||
def references_column(self, table: str, column: str) -> bool: ...
|
||||
def rename_column_references(
|
||||
self, table: str, old_column: str, new_column: str
|
||||
) -> None: ...
|
||||
|
||||
class Columns(TableColumns):
|
||||
columns: List[str]
|
||||
table: str
|
||||
quote_name: Callable = ...
|
||||
col_suffixes: Tuple = ...
|
||||
def __init__(
|
||||
self,
|
||||
table: str,
|
||||
columns: List[str],
|
||||
quote_name: Callable,
|
||||
col_suffixes: Union[List[str], Tuple] = ...,
|
||||
) -> None: ...
|
||||
|
||||
class IndexName(TableColumns):
|
||||
columns: List[str]
|
||||
table: str
|
||||
suffix: str = ...
|
||||
create_index_name: Callable = ...
|
||||
def __init__(
|
||||
self,
|
||||
table: str,
|
||||
columns: List[str],
|
||||
suffix: str,
|
||||
create_index_name: Callable,
|
||||
) -> None: ...
|
||||
|
||||
class ForeignKeyName(TableColumns):
|
||||
columns: List[str]
|
||||
table: str
|
||||
to_reference: TableColumns = ...
|
||||
suffix_template: str = ...
|
||||
create_fk_name: Callable = ...
|
||||
def __init__(
|
||||
self,
|
||||
from_table: str,
|
||||
from_columns: List[str],
|
||||
to_table: str,
|
||||
to_columns: List[str],
|
||||
suffix_template: str,
|
||||
create_fk_name: Callable,
|
||||
) -> None: ...
|
||||
def references_table(self, table: str) -> bool: ...
|
||||
def references_column(self, table: str, column: str) -> bool: ...
|
||||
def rename_table_references(
|
||||
self, old_table: str, new_table: str
|
||||
) -> None: ...
|
||||
def rename_column_references(
|
||||
self, table: str, old_column: str, new_column: str
|
||||
) -> None: ...
|
||||
|
||||
class Statement(Reference):
|
||||
template: str = ...
|
||||
parts: Dict[str, Table] = ...
|
||||
def __init__(self, template: str, **parts: Any) -> None: ...
|
||||
def references_table(self, table: str) -> bool: ...
|
||||
def references_column(self, table: str, column: str) -> bool: ...
|
||||
def rename_table_references(
|
||||
self, old_table: str, new_table: str
|
||||
) -> None: ...
|
||||
def rename_column_references(
|
||||
self, table: str, old_column: str, new_column: str
|
||||
) -> None: ...
|
||||
66
django-stubs-generated/db/backends/dummy/base.pyi
Normal file
66
django-stubs-generated/db/backends/dummy/base.pyi
Normal file
@@ -0,0 +1,66 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||
from django.db.backends.base.client import BaseDatabaseClient
|
||||
from django.db.backends.base.creation import BaseDatabaseCreation
|
||||
from django.db.backends.base.introspection import BaseDatabaseIntrospection
|
||||
from django.db.backends.base.operations import BaseDatabaseOperations
|
||||
|
||||
|
||||
def complain(*args: Any, **kwargs: Any) -> Any: ...
|
||||
def ignore(*args: Any, **kwargs: Any) -> None: ...
|
||||
|
||||
class DatabaseOperations(BaseDatabaseOperations):
|
||||
connection: django.db.backends.dummy.base.DatabaseWrapper
|
||||
quote_name: Any = ...
|
||||
|
||||
class DatabaseClient(BaseDatabaseClient):
|
||||
connection: django.db.backends.dummy.base.DatabaseWrapper
|
||||
runshell: Any = ...
|
||||
|
||||
class DatabaseCreation(BaseDatabaseCreation):
|
||||
connection: django.db.backends.dummy.base.DatabaseWrapper
|
||||
create_test_db: Any = ...
|
||||
destroy_test_db: Any = ...
|
||||
|
||||
class DatabaseIntrospection(BaseDatabaseIntrospection):
|
||||
connection: django.db.backends.dummy.base.DatabaseWrapper
|
||||
get_table_list: Any = ...
|
||||
get_table_description: Any = ...
|
||||
get_relations: Any = ...
|
||||
get_indexes: Any = ...
|
||||
get_key_columns: Any = ...
|
||||
|
||||
class DatabaseWrapper(BaseDatabaseWrapper):
|
||||
alias: str
|
||||
allow_thread_sharing: bool
|
||||
autocommit: bool
|
||||
client: django.db.backends.dummy.base.DatabaseClient
|
||||
close_at: None
|
||||
closed_in_transaction: bool
|
||||
commit_on_exit: bool
|
||||
connection: None
|
||||
creation: django.db.backends.dummy.base.DatabaseCreation
|
||||
errors_occurred: bool
|
||||
execute_wrappers: List[Any]
|
||||
features: django.db.backends.dummy.features.DummyDatabaseFeatures
|
||||
force_debug_cursor: bool
|
||||
in_atomic_block: bool
|
||||
introspection: django.db.backends.dummy.base.DatabaseIntrospection
|
||||
needs_rollback: bool
|
||||
ops: django.db.backends.dummy.base.DatabaseOperations
|
||||
queries_log: collections.deque
|
||||
run_commit_hooks_on_set_autocommit_on: bool
|
||||
run_on_commit: List[Any]
|
||||
savepoint_ids: List[Any]
|
||||
savepoint_state: int
|
||||
settings_dict: Dict[str, Optional[Union[Dict[str, None], int, str]]]
|
||||
validation: django.db.backends.base.validation.BaseDatabaseValidation
|
||||
operators: Any = ...
|
||||
ensure_connection: Any = ...
|
||||
client_class: Any = ...
|
||||
creation_class: Any = ...
|
||||
features_class: Any = ...
|
||||
introspection_class: Any = ...
|
||||
ops_class: Any = ...
|
||||
def is_usable(self): ...
|
||||
18
django-stubs-generated/db/backends/mysql/client.pyi
Normal file
18
django-stubs-generated/db/backends/mysql/client.pyi
Normal file
@@ -0,0 +1,18 @@
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
from django.db.backends.base.client import BaseDatabaseClient
|
||||
|
||||
|
||||
class DatabaseClient(BaseDatabaseClient):
|
||||
executable_name: str = ...
|
||||
@classmethod
|
||||
def settings_to_cmd_args(
|
||||
cls,
|
||||
settings_dict: Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[Dict[str, Dict[str, str]], int, str]
|
||||
],
|
||||
],
|
||||
) -> List[str]: ...
|
||||
def runshell(self) -> None: ...
|
||||
10
django-stubs-generated/db/backends/postgresql/client.pyi
Normal file
10
django-stubs-generated/db/backends/postgresql/client.pyi
Normal file
@@ -0,0 +1,10 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
from django.db.backends.base.client import BaseDatabaseClient
|
||||
|
||||
|
||||
class DatabaseClient(BaseDatabaseClient):
|
||||
executable_name: str = ...
|
||||
@classmethod
|
||||
def runshell_db(cls, conn_params: Dict[str, str]) -> None: ...
|
||||
def runshell(self) -> None: ...
|
||||
86
django-stubs-generated/db/backends/sqlite3/base.pyi
Normal file
86
django-stubs-generated/db/backends/sqlite3/base.pyi
Normal file
@@ -0,0 +1,86 @@
|
||||
import collections
|
||||
from datetime import datetime
|
||||
from sqlite3 import Connection
|
||||
from sqlite3 import dbapi2 as Database
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
|
||||
|
||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||
from django.db.backends.base.validation import BaseDatabaseValidation
|
||||
from django.db.backends.sqlite3.client import DatabaseClient
|
||||
|
||||
from .creation import DatabaseCreation
|
||||
from .features import DatabaseFeatures
|
||||
from .introspection import DatabaseIntrospection
|
||||
from .operations import DatabaseOperations
|
||||
|
||||
|
||||
def decoder(conv_func: Callable) -> Callable: ...
|
||||
|
||||
class DatabaseWrapper(BaseDatabaseWrapper):
|
||||
alias: str
|
||||
allow_thread_sharing: bool
|
||||
autocommit: bool
|
||||
client: DatabaseClient
|
||||
close_at: None
|
||||
closed_in_transaction: bool
|
||||
commit_on_exit: bool
|
||||
connection: None
|
||||
creation: DatabaseCreation
|
||||
errors_occurred: bool
|
||||
execute_wrappers: List[Any]
|
||||
features: DatabaseFeatures
|
||||
force_debug_cursor: bool
|
||||
in_atomic_block: bool
|
||||
introspection: DatabaseIntrospection
|
||||
needs_rollback: bool
|
||||
ops: DatabaseOperations
|
||||
queries_log: collections.deque
|
||||
run_commit_hooks_on_set_autocommit_on: bool
|
||||
run_on_commit: List[Any]
|
||||
savepoint_ids: List[Any]
|
||||
savepoint_state: int
|
||||
settings_dict: Dict[str, Optional[Union[Dict[str, None], int, str]]]
|
||||
validation: BaseDatabaseValidation
|
||||
vendor: str = ...
|
||||
display_name: str = ...
|
||||
data_types: Any = ...
|
||||
data_types_suffix: Any = ...
|
||||
operators: Any = ...
|
||||
pattern_esc: str = ...
|
||||
pattern_ops: Any = ...
|
||||
Database: Any = ...
|
||||
SchemaEditorClass: Any = ...
|
||||
client_class: Any = ...
|
||||
creation_class: Any = ...
|
||||
features_class: Any = ...
|
||||
introspection_class: Any = ...
|
||||
ops_class: Any = ...
|
||||
def get_connection_params(self) -> Dict[str, Union[int, str]]: ...
|
||||
def get_new_connection(
|
||||
self, conn_params: Dict[str, Union[int, str]]
|
||||
) -> Connection: ...
|
||||
def init_connection_state(self) -> None: ...
|
||||
def create_cursor(self, name: None = ...) -> SQLiteCursorWrapper: ...
|
||||
def close(self) -> None: ...
|
||||
def disable_constraint_checking(self) -> bool: ...
|
||||
def enable_constraint_checking(self) -> None: ...
|
||||
def check_constraints(
|
||||
self, table_names: Optional[List[str]] = ...
|
||||
) -> None: ...
|
||||
def is_usable(self): ...
|
||||
def is_in_memory_db(self) -> bool: ...
|
||||
|
||||
FORMAT_QMARK_REGEX: Any
|
||||
|
||||
class SQLiteCursorWrapper(Database.Cursor):
|
||||
def execute(
|
||||
self,
|
||||
query: str,
|
||||
params: Optional[
|
||||
Union[List[bool], List[datetime], List[float], Tuple]
|
||||
] = ...,
|
||||
) -> SQLiteCursorWrapper: ...
|
||||
def executemany(
|
||||
self, query: str, param_list: Union[Iterator[Any], List[Tuple[int]]]
|
||||
) -> SQLiteCursorWrapper: ...
|
||||
def convert_query(self, query: str) -> str: ...
|
||||
11
django-stubs-generated/db/backends/sqlite3/creation.pyi
Normal file
11
django-stubs-generated/db/backends/sqlite3/creation.pyi
Normal file
@@ -0,0 +1,11 @@
|
||||
from typing import Any, Optional, Tuple
|
||||
|
||||
from django.db.backends.base.creation import BaseDatabaseCreation
|
||||
|
||||
|
||||
class DatabaseCreation(BaseDatabaseCreation):
|
||||
connection: django.db.backends.sqlite3.base.DatabaseWrapper
|
||||
@staticmethod
|
||||
def is_in_memory_db(database_name: str) -> bool: ...
|
||||
def get_test_db_clone_settings(self, suffix: Any): ...
|
||||
def test_db_signature(self) -> Tuple[str, str]: ...
|
||||
31
django-stubs-generated/db/backends/sqlite3/features.pyi
Normal file
31
django-stubs-generated/db/backends/sqlite3/features.pyi
Normal file
@@ -0,0 +1,31 @@
|
||||
from typing import Optional
|
||||
|
||||
from django.db.backends.base.features import BaseDatabaseFeatures
|
||||
|
||||
|
||||
class DatabaseFeatures(BaseDatabaseFeatures):
|
||||
connection: django.db.backends.sqlite3.base.DatabaseWrapper
|
||||
can_use_chunked_reads: bool = ...
|
||||
test_db_allows_multiple_connections: bool = ...
|
||||
supports_unspecified_pk: bool = ...
|
||||
supports_timezones: bool = ...
|
||||
max_query_params: int = ...
|
||||
supports_mixed_date_datetime_comparisons: bool = ...
|
||||
supports_column_check_constraints: bool = ...
|
||||
autocommits_when_autocommit_is_off: bool = ...
|
||||
can_introspect_decimal_field: bool = ...
|
||||
can_introspect_positive_integer_field: bool = ...
|
||||
can_introspect_small_integer_field: bool = ...
|
||||
supports_transactions: bool = ...
|
||||
atomic_transactions: bool = ...
|
||||
can_rollback_ddl: bool = ...
|
||||
supports_atomic_references_rename: bool = ...
|
||||
supports_paramstyle_pyformat: bool = ...
|
||||
supports_sequence_reset: bool = ...
|
||||
can_clone_databases: bool = ...
|
||||
supports_temporal_subtraction: bool = ...
|
||||
ignores_table_name_case: bool = ...
|
||||
supports_cast_with_precision: bool = ...
|
||||
uses_savepoints: bool = ...
|
||||
can_release_savepoints: bool = ...
|
||||
def supports_stddev(self) -> bool: ...
|
||||
42
django-stubs-generated/db/backends/sqlite3/introspection.pyi
Normal file
42
django-stubs-generated/db/backends/sqlite3/introspection.pyi
Normal file
@@ -0,0 +1,42 @@
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
from django.db.backends.base.introspection import (BaseDatabaseIntrospection,
|
||||
FieldInfo, TableInfo)
|
||||
from django.db.backends.utils import CursorWrapper
|
||||
from django.db.models.fields import Field
|
||||
|
||||
field_size_re: Any
|
||||
|
||||
def get_field_size(name: str) -> Optional[int]: ...
|
||||
|
||||
class FlexibleFieldLookupDict:
|
||||
base_data_types_reverse: Any = ...
|
||||
def __getitem__(
|
||||
self, key: str
|
||||
) -> Union[Tuple[str, Dict[str, int]], str]: ...
|
||||
|
||||
class DatabaseIntrospection(BaseDatabaseIntrospection):
|
||||
connection: django.db.backends.sqlite3.base.DatabaseWrapper
|
||||
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_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]]]: ...
|
||||
119
django-stubs-generated/db/backends/sqlite3/operations.pyi
Normal file
119
django-stubs-generated/db/backends/sqlite3/operations.pyi
Normal file
@@ -0,0 +1,119 @@
|
||||
from datetime import date, datetime, time, timedelta
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
from uuid import UUID
|
||||
|
||||
from django.core.management.color import Style
|
||||
from django.db.backends.base.operations import BaseDatabaseOperations
|
||||
from django.db.backends.sqlite3.base import (DatabaseWrapper,
|
||||
SQLiteCursorWrapper)
|
||||
from django.db.backends.utils import CursorDebugWrapper
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.expressions import (BaseExpression, Col, Expression, F,
|
||||
SQLiteNumericMixin)
|
||||
from django.db.models.fields import Field
|
||||
from django.utils.datastructures import ImmutableList
|
||||
|
||||
|
||||
class DatabaseOperations(BaseDatabaseOperations):
|
||||
connection: django.db.backends.sqlite3.base.DatabaseWrapper
|
||||
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 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: ...
|
||||
def format_for_duration_arithmetic(self, sql: str) -> str: ...
|
||||
def date_trunc_sql(self, lookup_type: str, field_name: str) -> str: ...
|
||||
def time_trunc_sql(self, lookup_type: str, field_name: str) -> str: ...
|
||||
def datetime_cast_date_sql(
|
||||
self, field_name: str, tzname: Optional[str]
|
||||
) -> str: ...
|
||||
def datetime_cast_time_sql(
|
||||
self, field_name: str, tzname: Optional[str]
|
||||
) -> str: ...
|
||||
def datetime_extract_sql(
|
||||
self, lookup_type: str, field_name: str, tzname: Optional[str]
|
||||
) -> str: ...
|
||||
def datetime_trunc_sql(
|
||||
self, lookup_type: str, field_name: str, tzname: Optional[str]
|
||||
) -> str: ...
|
||||
def time_extract_sql(self, lookup_type: str, field_name: str) -> str: ...
|
||||
def pk_default_value(self) -> str: ...
|
||||
def last_executed_query(
|
||||
self,
|
||||
cursor: Union[SQLiteCursorWrapper, CursorDebugWrapper],
|
||||
sql: str,
|
||||
params: Optional[Union[List[int], List[str], Tuple]],
|
||||
) -> str: ...
|
||||
def quote_name(self, name: str) -> str: ...
|
||||
def no_limit_value(self) -> int: ...
|
||||
def sql_flush(
|
||||
self,
|
||||
style: Style,
|
||||
tables: List[str],
|
||||
sequences: Union[List[Dict[str, str]], Tuple],
|
||||
allow_cascade: bool = ...,
|
||||
) -> List[str]: ...
|
||||
def execute_sql_flush(self, using: str, sql_list: List[str]) -> None: ...
|
||||
def adapt_datetimefield_value(
|
||||
self, value: Optional[Union[datetime, F]]
|
||||
) -> Optional[Union[F, str]]: ...
|
||||
def adapt_timefield_value(
|
||||
self, value: Optional[Union[time, F]]
|
||||
) -> Optional[Union[F, str]]: ...
|
||||
def get_db_converters(self, expression: Expression) -> List[Callable]: ...
|
||||
def convert_datetimefield_value(
|
||||
self,
|
||||
value: Optional[Union[datetime, str]],
|
||||
expression: Expression,
|
||||
connection: DatabaseWrapper,
|
||||
) -> Optional[datetime]: ...
|
||||
def convert_datefield_value(
|
||||
self,
|
||||
value: Optional[Union[date, str]],
|
||||
expression: Expression,
|
||||
connection: DatabaseWrapper,
|
||||
) -> Optional[date]: ...
|
||||
def convert_timefield_value(
|
||||
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_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]]],
|
||||
) -> str: ...
|
||||
def combine_expression(
|
||||
self, connector: str, sub_expressions: List[str]
|
||||
) -> str: ...
|
||||
def combine_duration_expression(
|
||||
self, connector: str, sub_expressions: List[str]
|
||||
) -> str: ...
|
||||
def integer_field_range(self, internal_type: str) -> Tuple[None, None]: ...
|
||||
def subtract_temporals(
|
||||
self,
|
||||
internal_type: str,
|
||||
lhs: Tuple[str, List[Any]],
|
||||
rhs: Tuple[str, List[str]],
|
||||
) -> Tuple[str, List[str]]: ...
|
||||
40
django-stubs-generated/db/backends/sqlite3/schema.pyi
Normal file
40
django-stubs-generated/db/backends/sqlite3/schema.pyi
Normal file
@@ -0,0 +1,40 @@
|
||||
from typing import Any, Optional, Type, Union
|
||||
|
||||
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.fields import Field
|
||||
|
||||
|
||||
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
|
||||
atomic_migration: bool
|
||||
collect_sql: bool
|
||||
connection: django.db.backends.sqlite3.base.DatabaseWrapper
|
||||
sql_delete_table: str = ...
|
||||
sql_create_fk: Any = ...
|
||||
sql_create_inline_fk: str = ...
|
||||
sql_create_unique: str = ...
|
||||
sql_delete_unique: str = ...
|
||||
def __enter__(self) -> DatabaseSchemaEditor: ...
|
||||
def __exit__(
|
||||
self, exc_type: None, exc_value: None, traceback: None
|
||||
) -> None: ...
|
||||
def quote_value(self, value: Optional[Union[int, str]]) -> str: ...
|
||||
def alter_db_table(
|
||||
self,
|
||||
model: Type[Model],
|
||||
old_db_table: str,
|
||||
new_db_table: str,
|
||||
disable_constraints: bool = ...,
|
||||
) -> None: ...
|
||||
def alter_field(
|
||||
self,
|
||||
model: Type[Model],
|
||||
old_field: Field,
|
||||
new_field: Field,
|
||||
strict: bool = ...,
|
||||
) -> None: ...
|
||||
def delete_model(
|
||||
self, model: Type[Model], handle_autom2m: bool = ...
|
||||
) -> None: ...
|
||||
def add_field(self, model: Type[Model], field: Field) -> None: ...
|
||||
def remove_field(self, model: Type[Model], field: Field) -> None: ...
|
||||
65
django-stubs-generated/db/backends/utils.pyi
Normal file
65
django-stubs-generated/db/backends/utils.pyi
Normal file
@@ -0,0 +1,65 @@
|
||||
from datetime import date, datetime, time
|
||||
from decimal import Decimal
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
|
||||
|
||||
from django.db.backends.sqlite3.base import (DatabaseWrapper,
|
||||
SQLiteCursorWrapper)
|
||||
|
||||
logger: Any
|
||||
|
||||
class CursorWrapper:
|
||||
cursor: django.db.backends.sqlite3.base.SQLiteCursorWrapper = ...
|
||||
db: django.db.backends.sqlite3.base.DatabaseWrapper = ...
|
||||
def __init__(
|
||||
self, cursor: SQLiteCursorWrapper, db: DatabaseWrapper
|
||||
) -> None: ...
|
||||
WRAP_ERROR_ATTRS: Any = ...
|
||||
def __getattr__(
|
||||
self, attr: str
|
||||
) -> Union[
|
||||
Callable, Tuple[Tuple[str, None, None, None, None, None, None]], int
|
||||
]: ...
|
||||
def __iter__(self) -> None: ...
|
||||
def __enter__(self) -> CursorWrapper: ...
|
||||
def __exit__(self, type: None, value: None, traceback: None) -> None: ...
|
||||
def callproc(
|
||||
self,
|
||||
procname: str,
|
||||
params: List[Any] = ...,
|
||||
kparams: Dict[str, int] = ...,
|
||||
) -> Any: ...
|
||||
def execute(
|
||||
self,
|
||||
sql: str,
|
||||
params: Optional[
|
||||
Union[List[bool], List[datetime], List[float], Tuple]
|
||||
] = ...,
|
||||
) -> Optional[SQLiteCursorWrapper]: ...
|
||||
def executemany(
|
||||
self,
|
||||
sql: str,
|
||||
param_list: Union[Iterator[Any], List[Tuple[Union[int, str]]]],
|
||||
) -> Optional[SQLiteCursorWrapper]: ...
|
||||
|
||||
class CursorDebugWrapper(CursorWrapper):
|
||||
cursor: django.db.backends.sqlite3.base.SQLiteCursorWrapper
|
||||
db: django.db.backends.sqlite3.base.DatabaseWrapper
|
||||
def execute(
|
||||
self, sql: str, params: Optional[Union[List[str], Tuple]] = ...
|
||||
) -> Any: ...
|
||||
def executemany(self, sql: str, param_list: Iterator[Any]) -> Any: ...
|
||||
|
||||
def typecast_date(s: Optional[str]) -> Optional[date]: ...
|
||||
def typecast_time(s: Optional[str]) -> Optional[time]: ...
|
||||
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 strip_quotes(table_name: str) -> str: ...
|
||||
6
django-stubs-generated/db/migrations/__init__.pyi
Normal file
6
django-stubs-generated/db/migrations/__init__.pyi
Normal file
@@ -0,0 +1,6 @@
|
||||
# Stubs for django.db.migrations (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from .migration import Migration as Migration, swappable_dependency as swappable_dependency
|
||||
from .operations import *
|
||||
80
django-stubs-generated/db/migrations/autodetector.pyi
Normal file
80
django-stubs-generated/db/migrations/autodetector.pyi
Normal file
@@ -0,0 +1,80 @@
|
||||
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
|
||||
|
||||
from django.db.migrations.graph import MigrationGraph
|
||||
from django.db.migrations.migration import Migration
|
||||
from django.db.migrations.operations.base import Operation
|
||||
from django.db.migrations.questioner import MigrationQuestioner
|
||||
from django.db.migrations.state import ProjectState
|
||||
from django.db.models.fields import Field
|
||||
|
||||
from .topological_sort import stable_topological_sort
|
||||
|
||||
|
||||
class MigrationAutodetector:
|
||||
from_state: django.db.migrations.state.ProjectState = ...
|
||||
to_state: django.db.migrations.state.ProjectState = ...
|
||||
questioner: django.db.migrations.questioner.MigrationQuestioner = ...
|
||||
existing_apps: Set[Any] = ...
|
||||
def __init__(
|
||||
self,
|
||||
from_state: ProjectState,
|
||||
to_state: ProjectState,
|
||||
questioner: Optional[MigrationQuestioner] = ...,
|
||||
) -> None: ...
|
||||
def changes(
|
||||
self,
|
||||
graph: MigrationGraph,
|
||||
trim_to_apps: Optional[Set[str]] = ...,
|
||||
convert_apps: Optional[Set[str]] = ...,
|
||||
migration_name: Optional[str] = ...,
|
||||
) -> Dict[str, List[Migration]]: ...
|
||||
def deep_deconstruct(self, obj: Any) -> Any: ...
|
||||
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 add_operation(
|
||||
self,
|
||||
app_label: str,
|
||||
operation: Operation,
|
||||
dependencies: Optional[
|
||||
List[Tuple[str, str, Optional[str], Union[bool, str]]]
|
||||
] = ...,
|
||||
beginning: bool = ...,
|
||||
) -> None: ...
|
||||
def swappable_first_key(self, item: Tuple[str, str]) -> Tuple[str, str]: ...
|
||||
renamed_models: Any = ...
|
||||
renamed_models_rel: Any = ...
|
||||
def generate_renamed_models(self) -> None: ...
|
||||
def generate_created_models(self) -> None: ...
|
||||
def generate_created_proxies(self) -> None: ...
|
||||
def generate_deleted_models(self) -> None: ...
|
||||
def generate_deleted_proxies(self) -> None: ...
|
||||
renamed_fields: Any = ...
|
||||
def generate_renamed_fields(self) -> None: ...
|
||||
def generate_added_fields(self) -> None: ...
|
||||
def generate_removed_fields(self) -> None: ...
|
||||
def generate_altered_fields(self) -> None: ...
|
||||
def create_altered_indexes(self) -> None: ...
|
||||
def generate_added_indexes(self) -> None: ...
|
||||
def generate_removed_indexes(self) -> None: ...
|
||||
def generate_altered_unique_together(self) -> None: ...
|
||||
def generate_altered_index_together(self) -> None: ...
|
||||
def generate_altered_db_table(self) -> None: ...
|
||||
def generate_altered_options(self) -> None: ...
|
||||
def generate_altered_order_with_respect_to(self) -> None: ...
|
||||
def generate_altered_managers(self) -> None: ...
|
||||
def arrange_for_graph(
|
||||
self,
|
||||
changes: Dict[str, List[Migration]],
|
||||
graph: MigrationGraph,
|
||||
migration_name: Optional[str] = ...,
|
||||
) -> Dict[str, List[Migration]]: ...
|
||||
@classmethod
|
||||
def suggest_name(cls, ops: List[Operation]) -> str: ...
|
||||
@classmethod
|
||||
def parse_number(cls, name: str) -> int: ...
|
||||
26
django-stubs-generated/db/migrations/exceptions.pyi
Normal file
26
django-stubs-generated/db/migrations/exceptions.pyi
Normal file
@@ -0,0 +1,26 @@
|
||||
from typing import Any, Optional, Tuple
|
||||
|
||||
from django.db.migrations.migration import Migration
|
||||
from django.db.utils import DatabaseError
|
||||
|
||||
|
||||
class AmbiguityError(Exception): ...
|
||||
class BadMigrationError(Exception): ...
|
||||
class CircularDependencyError(Exception): ...
|
||||
class InconsistentMigrationHistory(Exception): ...
|
||||
class InvalidBasesError(ValueError): ...
|
||||
class IrreversibleError(RuntimeError): ...
|
||||
|
||||
class NodeNotFoundError(LookupError):
|
||||
message: str = ...
|
||||
origin: None = ...
|
||||
node: Tuple[str, str] = ...
|
||||
def __init__(
|
||||
self,
|
||||
message: str,
|
||||
node: Tuple[str, str],
|
||||
origin: Optional[Migration] = ...,
|
||||
) -> None: ...
|
||||
|
||||
class MigrationSchemaMissing(DatabaseError): ...
|
||||
class InvalidMigrationPlan(ValueError): ...
|
||||
53
django-stubs-generated/db/migrations/executor.pyi
Normal file
53
django-stubs-generated/db/migrations/executor.pyi
Normal file
@@ -0,0 +1,53 @@
|
||||
from typing import Any, Callable, List, Optional, Set, Tuple, Union
|
||||
|
||||
from django.db import DefaultConnectionProxy
|
||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||
from django.db.migrations.migration import Migration
|
||||
from django.db.migrations.state import ProjectState
|
||||
|
||||
from .exceptions import InvalidMigrationPlan
|
||||
from .loader import MigrationLoader
|
||||
from .recorder import MigrationRecorder
|
||||
from .state import ProjectState
|
||||
|
||||
|
||||
class MigrationExecutor:
|
||||
connection: django.db.backends.sqlite3.base.DatabaseWrapper = ...
|
||||
loader: django.db.migrations.loader.MigrationLoader = ...
|
||||
recorder: django.db.migrations.recorder.MigrationRecorder = ...
|
||||
progress_callback: Callable = ...
|
||||
def __init__(
|
||||
self,
|
||||
connection: Optional[
|
||||
Union[DefaultConnectionProxy, BaseDatabaseWrapper]
|
||||
],
|
||||
progress_callback: Optional[Callable] = ...,
|
||||
) -> None: ...
|
||||
def migration_plan(
|
||||
self,
|
||||
targets: Union[List[Tuple[str, Optional[str]]], Set[Tuple[str, str]]],
|
||||
clean_start: bool = ...,
|
||||
) -> List[Tuple[Migration, bool]]: ...
|
||||
def migrate(
|
||||
self,
|
||||
targets: Optional[List[Tuple[str, Optional[str]]]],
|
||||
plan: Optional[List[Tuple[Migration, bool]]] = ...,
|
||||
state: Optional[ProjectState] = ...,
|
||||
fake: bool = ...,
|
||||
fake_initial: bool = ...,
|
||||
) -> ProjectState: ...
|
||||
def collect_sql(self, plan: List[Tuple[Migration, bool]]) -> List[str]: ...
|
||||
def apply_migration(
|
||||
self,
|
||||
state: ProjectState,
|
||||
migration: Migration,
|
||||
fake: bool = ...,
|
||||
fake_initial: bool = ...,
|
||||
) -> 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]: ...
|
||||
83
django-stubs-generated/db/migrations/graph.pyi
Normal file
83
django-stubs-generated/db/migrations/graph.pyi
Normal file
@@ -0,0 +1,83 @@
|
||||
from typing import Any, Callable, List, Optional, Tuple, Union
|
||||
|
||||
from django.db.migrations.migration import Migration, SwappableTuple
|
||||
from django.db.migrations.state import ProjectState
|
||||
|
||||
from .exceptions import CircularDependencyError, NodeNotFoundError
|
||||
|
||||
RECURSION_DEPTH_WARNING: str
|
||||
|
||||
class Node:
|
||||
key: Tuple[str, str] = ...
|
||||
children: Set[Any] = ...
|
||||
parents: Set[Any] = ...
|
||||
def __init__(self, key: Tuple[str, str]) -> None: ...
|
||||
def __eq__(self, other: Tuple[str, str]) -> bool: ...
|
||||
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: ...
|
||||
def ancestors(self) -> List[Tuple[str, str]]: ...
|
||||
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: Migration, error_message: str
|
||||
) -> None: ...
|
||||
__class__: Any = ...
|
||||
def promote(self) -> None: ...
|
||||
def raise_error(self) -> None: ...
|
||||
|
||||
class MigrationGraph:
|
||||
node_map: Dict[Any, Any] = ...
|
||||
nodes: Dict[Any, Any] = ...
|
||||
cached: bool = ...
|
||||
def __init__(self) -> None: ...
|
||||
def add_node(
|
||||
self, key: Tuple[str, str], migration: Optional[Migration]
|
||||
) -> None: ...
|
||||
def add_dummy_node(
|
||||
self, key: Tuple[str, str], origin: Migration, error_message: str
|
||||
) -> None: ...
|
||||
def add_dependency(
|
||||
self,
|
||||
migration: Optional[Union[Migration, str]],
|
||||
child: Tuple[str, str],
|
||||
parent: Tuple[str, str],
|
||||
skip_validation: bool = ...,
|
||||
) -> None: ...
|
||||
def remove_replaced_nodes(
|
||||
self, replacement: Tuple[str, str], replaced: List[Tuple[str, str]]
|
||||
) -> None: ...
|
||||
def remove_replacement_node(
|
||||
self, replacement: Tuple[str, str], replaced: List[Tuple[str, str]]
|
||||
) -> None: ...
|
||||
def validate_consistency(self) -> None: ...
|
||||
def clear_cache(self) -> None: ...
|
||||
def forwards_plan(
|
||||
self, target: Tuple[str, str]
|
||||
) -> List[Tuple[str, str]]: ...
|
||||
def backwards_plan(
|
||||
self, target: Union[Tuple[str, str], Node]
|
||||
) -> List[Tuple[str, str]]: ...
|
||||
def iterative_dfs(self, start: Any, forwards: bool = ...): ...
|
||||
def root_nodes(self, app: Optional[str] = ...) -> List[Tuple[str, str]]: ...
|
||||
def leaf_nodes(self, app: Optional[str] = ...) -> List[Tuple[str, str]]: ...
|
||||
def ensure_not_cyclic(
|
||||
self, start: Union[Tuple[str, str], Node], get_children: Callable
|
||||
) -> None: ...
|
||||
def make_state(
|
||||
self,
|
||||
nodes: Optional[Tuple[str, str]] = ...,
|
||||
at_end: bool = ...,
|
||||
real_apps: List[str] = ...,
|
||||
) -> ProjectState: ...
|
||||
def __contains__(
|
||||
self, node: Union[Tuple[str, str], SwappableTuple]
|
||||
) -> bool: ...
|
||||
58
django-stubs-generated/db/migrations/loader.pyi
Normal file
58
django-stubs-generated/db/migrations/loader.pyi
Normal file
@@ -0,0 +1,58 @@
|
||||
from typing import Any, Dict, Optional, 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 .exceptions import (AmbiguityError, BadMigrationError,
|
||||
InconsistentMigrationHistory, NodeNotFoundError)
|
||||
|
||||
MIGRATIONS_MODULE_NAME: str
|
||||
|
||||
class MigrationLoader:
|
||||
connection: django.db.backends.sqlite3.base.DatabaseWrapper = ...
|
||||
disk_migrations: Dict[
|
||||
Tuple[str, str], django.db.migrations.migration.Migration
|
||||
] = ...
|
||||
applied_migrations: None = ...
|
||||
ignore_no_migrations: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
connection: Optional[
|
||||
Union[DefaultConnectionProxy, BaseDatabaseWrapper]
|
||||
],
|
||||
load: bool = ...,
|
||||
ignore_no_migrations: bool = ...,
|
||||
) -> None: ...
|
||||
@classmethod
|
||||
def migrations_module(
|
||||
cls, app_label: str
|
||||
) -> Tuple[Optional[str], bool]: ...
|
||||
unmigrated_apps: Set[str] = ...
|
||||
migrated_apps: Set[str] = ...
|
||||
def load_disk(self) -> None: ...
|
||||
def get_migration(self, app_label: str, name_prefix: str) -> Migration: ...
|
||||
def get_migration_by_prefix(
|
||||
self, app_label: str, name_prefix: str
|
||||
) -> Migration: ...
|
||||
def check_key(
|
||||
self, key: Union[Tuple[str, str], SwappableTuple], current_app: str
|
||||
) -> Optional[Tuple[str, str]]: ...
|
||||
def add_internal_dependencies(
|
||||
self, key: Tuple[str, str], migration: Migration
|
||||
) -> None: ...
|
||||
def add_external_dependencies(
|
||||
self, key: Tuple[str, str], migration: Migration
|
||||
) -> None: ...
|
||||
graph: Any = ...
|
||||
replacements: Any = ...
|
||||
def build_graph(self) -> None: ...
|
||||
def check_consistent_history(
|
||||
self, connection: Union[DefaultConnectionProxy, DatabaseWrapper]
|
||||
) -> None: ...
|
||||
def detect_conflicts(self) -> Dict[str, Set[str]]: ...
|
||||
def project_state(
|
||||
self, nodes: Optional[Tuple[str, str]] = ..., at_end: bool = ...
|
||||
) -> ProjectState: ...
|
||||
41
django-stubs-generated/db/migrations/migration.pyi
Normal file
41
django-stubs-generated/db/migrations/migration.pyi
Normal file
@@ -0,0 +1,41 @@
|
||||
from typing import Any, Tuple, Type, List
|
||||
|
||||
from django.db.backends.sqlite3.schema import DatabaseSchemaEditor
|
||||
from django.db.migrations.state import ProjectState
|
||||
|
||||
|
||||
class Migration:
|
||||
operations: List[Any] = ...
|
||||
dependencies: List[Any] = ...
|
||||
run_before: List[Any] = ...
|
||||
replaces: List[Any] = ...
|
||||
initial: Any = ...
|
||||
atomic: bool = ...
|
||||
name: str = ...
|
||||
app_label: str = ...
|
||||
def __init__(self, name: str, app_label: str) -> None: ...
|
||||
def __eq__(self, other: Migration) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def mutate_state(
|
||||
self, project_state: ProjectState, preserve: bool = ...
|
||||
) -> ProjectState: ...
|
||||
def apply(
|
||||
self,
|
||||
project_state: ProjectState,
|
||||
schema_editor: DatabaseSchemaEditor,
|
||||
collect_sql: bool = ...,
|
||||
) -> ProjectState: ...
|
||||
def unapply(
|
||||
self,
|
||||
project_state: ProjectState,
|
||||
schema_editor: DatabaseSchemaEditor,
|
||||
collect_sql: bool = ...,
|
||||
) -> ProjectState: ...
|
||||
|
||||
class SwappableTuple(tuple):
|
||||
setting: str = ...
|
||||
def __new__(
|
||||
cls: Type[SwappableTuple], value: Tuple[str, str], setting: str
|
||||
) -> SwappableTuple: ...
|
||||
|
||||
def swappable_dependency(value: str) -> SwappableTuple: ...
|
||||
64
django-stubs-generated/db/migrations/operations/__init__.pyi
Normal file
64
django-stubs-generated/db/migrations/operations/__init__.pyi
Normal file
@@ -0,0 +1,64 @@
|
||||
# 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,
|
||||
RemoveField as RemoveField,
|
||||
RenameField as RenameField,
|
||||
)
|
||||
from .models import (
|
||||
AddIndex as AddIndex,
|
||||
AlterIndexTogether as AlterIndexTogether,
|
||||
AlterModelManagers as AlterModelManagers,
|
||||
AlterModelOptions as AlterModelOptions,
|
||||
AlterModelTable as AlterModelTable,
|
||||
AlterOrderWithRespectTo as AlterOrderWithRespectTo,
|
||||
AlterUniqueTogether as AlterUniqueTogether,
|
||||
CreateModel as CreateModel,
|
||||
DeleteModel as DeleteModel,
|
||||
RemoveIndex as RemoveIndex,
|
||||
RenameModel as RenameModel,
|
||||
)
|
||||
from .special import (
|
||||
RunPython as RunPython,
|
||||
RunSQL as RunSQL,
|
||||
SeparateDatabaseAndState as SeparateDatabaseAndState,
|
||||
)
|
||||
from .fields import AddField, AlterField, RemoveField, RenameField
|
||||
from .models import (
|
||||
AddIndex,
|
||||
AlterIndexTogether,
|
||||
AlterModelManagers,
|
||||
AlterModelOptions,
|
||||
AlterModelTable,
|
||||
AlterOrderWithRespectTo,
|
||||
AlterUniqueTogether,
|
||||
CreateModel,
|
||||
DeleteModel,
|
||||
RemoveIndex,
|
||||
RenameModel,
|
||||
)
|
||||
from .special import RunPython, RunSQL, SeparateDatabaseAndState
|
||||
|
||||
__all__ = [
|
||||
"CreateModel",
|
||||
"DeleteModel",
|
||||
"AlterModelTable",
|
||||
"AlterUniqueTogether",
|
||||
"RenameModel",
|
||||
"AlterIndexTogether",
|
||||
"AlterModelOptions",
|
||||
"AddIndex",
|
||||
"RemoveIndex",
|
||||
"AddField",
|
||||
"RemoveField",
|
||||
"AlterField",
|
||||
"RenameField",
|
||||
"SeparateDatabaseAndState",
|
||||
"RunSQL",
|
||||
"RunPython",
|
||||
"AlterOrderWithRespectTo",
|
||||
"AlterModelManagers",
|
||||
]
|
||||
32
django-stubs-generated/db/migrations/operations/base.pyi
Normal file
32
django-stubs-generated/db/migrations/operations/base.pyi
Normal file
@@ -0,0 +1,32 @@
|
||||
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 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 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 allow_migrate_model(self, connection_alias: Any, model: Any): ...
|
||||
def reduce(
|
||||
self,
|
||||
operation: Operation,
|
||||
in_between: List[Operation],
|
||||
app_label: str = ...,
|
||||
) -> bool: ...
|
||||
145
django-stubs-generated/db/migrations/operations/fields.pyi
Normal file
145
django-stubs-generated/db/migrations/operations/fields.pyi
Normal file
@@ -0,0 +1,145 @@
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
from django.db.backends.sqlite3.schema import DatabaseSchemaEditor
|
||||
from django.db.migrations.operations.base import Operation
|
||||
from django.db.migrations.state import ProjectState
|
||||
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 = ...
|
||||
def __init__(self, model_name: str, name: str) -> None: ...
|
||||
def model_name_lower(self) -> str: ...
|
||||
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: ...
|
||||
|
||||
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 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: 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: ...
|
||||
|
||||
class RemoveField(FieldOperation):
|
||||
model_name: str
|
||||
model_name_lower: str
|
||||
name: str
|
||||
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,
|
||||
) -> None: ...
|
||||
def database_backwards(
|
||||
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 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
|
||||
) -> None: ...
|
||||
def describe(self) -> str: ...
|
||||
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 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 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: ...
|
||||
370
django-stubs-generated/db/migrations/operations/models.pyi
Normal file
370
django-stubs-generated/db/migrations/operations/models.pyi
Normal file
@@ -0,0 +1,370 @@
|
||||
from typing import Any, Dict, List, Optional, Set, Tuple, Type, Union
|
||||
|
||||
from django.contrib.postgres.fields.citext import CIText
|
||||
from django.db.backends.sqlite3.schema import DatabaseSchemaEditor
|
||||
from django.db.migrations.operations.base import Operation
|
||||
from django.db.migrations.state import ProjectState
|
||||
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: ...
|
||||
|
||||
|
||||
class CreateModel(ModelOperation):
|
||||
serialization_expand_args: Any = ...
|
||||
fields: Any = ...
|
||||
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]]] = ...,
|
||||
) -> None: ...
|
||||
|
||||
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,
|
||||
) -> None: ...
|
||||
|
||||
def database_backwards(
|
||||
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 = ...,
|
||||
) -> 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,
|
||||
) -> None: ...
|
||||
|
||||
def database_backwards(
|
||||
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,
|
||||
) -> None: ...
|
||||
|
||||
def database_backwards(
|
||||
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: ...
|
||||
|
||||
|
||||
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 describe(self): ...
|
||||
|
||||
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: ...
|
||||
|
||||
|
||||
class FieldRelatedOptionOperation(ModelOptionOperation):
|
||||
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 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: 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 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 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 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 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 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 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 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 deconstruct(self): ...
|
||||
|
||||
def describe(self): ...
|
||||
99
django-stubs-generated/db/migrations/operations/special.pyi
Normal file
99
django-stubs-generated/db/migrations/operations/special.pyi
Normal file
@@ -0,0 +1,99 @@
|
||||
from typing import Any, Callable, List, Optional
|
||||
|
||||
from django.db.backends.sqlite3.schema import DatabaseSchemaEditor
|
||||
from django.db.migrations.operations.models import CreateModel
|
||||
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 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,
|
||||
) -> None: ...
|
||||
def database_backwards(
|
||||
self,
|
||||
app_label: str,
|
||||
schema_editor: DatabaseSchemaEditor,
|
||||
from_state: ProjectState,
|
||||
to_state: ProjectState,
|
||||
) -> None: ...
|
||||
def describe(self): ...
|
||||
|
||||
class RunSQL(Operation):
|
||||
noop: str = ...
|
||||
sql: Any = ...
|
||||
reverse_sql: Any = ...
|
||||
state_operations: Any = ...
|
||||
hints: Any = ...
|
||||
elidable: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
sql: Any,
|
||||
reverse_sql: Optional[Any] = ...,
|
||||
state_operations: Optional[Any] = ...,
|
||||
hints: Optional[Any] = ...,
|
||||
elidable: bool = ...,
|
||||
) -> None: ...
|
||||
def deconstruct(self): ...
|
||||
@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 describe(self): ...
|
||||
|
||||
class RunPython(Operation):
|
||||
reduces_to_sql: bool = ...
|
||||
atomic: Any = ...
|
||||
code: Any = ...
|
||||
reverse_code: Any = ...
|
||||
hints: Any = ...
|
||||
elidable: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
code: Callable,
|
||||
reverse_code: Optional[Callable] = ...,
|
||||
atomic: Optional[bool] = ...,
|
||||
hints: None = ...,
|
||||
elidable: bool = ...,
|
||||
) -> None: ...
|
||||
def deconstruct(self): ...
|
||||
@property
|
||||
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,
|
||||
) -> None: ...
|
||||
def database_backwards(
|
||||
self,
|
||||
app_label: str,
|
||||
schema_editor: DatabaseSchemaEditor,
|
||||
from_state: ProjectState,
|
||||
to_state: ProjectState,
|
||||
) -> None: ...
|
||||
def describe(self): ...
|
||||
@staticmethod
|
||||
def noop(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None: ...
|
||||
@@ -0,0 +1,9 @@
|
||||
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: ...
|
||||
12
django-stubs-generated/db/migrations/optimizer.pyi
Normal file
12
django-stubs-generated/db/migrations/optimizer.pyi
Normal file
@@ -0,0 +1,12 @@
|
||||
from typing import Any, 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]: ...
|
||||
66
django-stubs-generated/db/migrations/questioner.pyi
Normal file
66
django-stubs-generated/db/migrations/questioner.pyi
Normal file
@@ -0,0 +1,66 @@
|
||||
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 = ...
|
||||
def __init__(
|
||||
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: ...
|
||||
def ask_not_null_alteration(self, field_name: Any, model_name: Any): ...
|
||||
def ask_rename(
|
||||
self,
|
||||
model_name: str,
|
||||
old_name: str,
|
||||
new_name: str,
|
||||
field_instance: Field,
|
||||
) -> bool: ...
|
||||
def ask_rename_model(
|
||||
self, old_model_state: ModelState, new_model_state: ModelState
|
||||
) -> bool: ...
|
||||
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: ...
|
||||
33
django-stubs-generated/db/migrations/recorder.pyi
Normal file
33
django-stubs-generated/db/migrations/recorder.pyi
Normal file
@@ -0,0 +1,33 @@
|
||||
from typing import Any, Optional, Set, Tuple, Union
|
||||
|
||||
from django.db import DefaultConnectionProxy, models
|
||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||
from django.db.models.query import QuerySet
|
||||
|
||||
from .exceptions import MigrationSchemaMissing
|
||||
|
||||
|
||||
class MigrationRecorder:
|
||||
class Migration(models.Model):
|
||||
app: Any = ...
|
||||
name: Any = ...
|
||||
applied: Any = ...
|
||||
class Meta:
|
||||
apps: Any = ...
|
||||
app_label: str = ...
|
||||
db_table: str = ...
|
||||
connection: django.db.backends.sqlite3.base.DatabaseWrapper = ...
|
||||
def __init__(
|
||||
self,
|
||||
connection: Optional[
|
||||
Union[DefaultConnectionProxy, BaseDatabaseWrapper]
|
||||
],
|
||||
) -> None: ...
|
||||
@property
|
||||
def migration_qs(self) -> QuerySet: ...
|
||||
def has_table(self) -> bool: ...
|
||||
def ensure_schema(self) -> None: ...
|
||||
def applied_migrations(self) -> Set[Tuple[str, str]]: ...
|
||||
def record_applied(self, app: str, name: str) -> None: ...
|
||||
def record_unapplied(self, app: str, name: str) -> None: ...
|
||||
def flush(self) -> None: ...
|
||||
87
django-stubs-generated/db/migrations/serializer.pyi
Normal file
87
django-stubs-generated/db/migrations/serializer.pyi
Normal file
@@ -0,0 +1,87 @@
|
||||
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
|
||||
|
||||
|
||||
class BaseSerializer:
|
||||
value: Any = ...
|
||||
def __init__(self, value: Any) -> None: ...
|
||||
def serialize(self) -> None: ...
|
||||
|
||||
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 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 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: django.db.models.fields.AutoField
|
||||
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 SequenceSerializer(BaseSequenceSerializer): ...
|
||||
class SetSerializer(BaseSequenceSerializer): ...
|
||||
|
||||
class SettingsReferenceSerializer(BaseSerializer):
|
||||
def serialize(self): ...
|
||||
|
||||
class TimedeltaSerializer(BaseSerializer):
|
||||
def serialize(self): ...
|
||||
|
||||
class TimeSerializer(BaseSerializer):
|
||||
def serialize(self): ...
|
||||
|
||||
class TupleSerializer(BaseSequenceSerializer): ...
|
||||
|
||||
class TypeSerializer(BaseSerializer):
|
||||
def serialize(self): ...
|
||||
|
||||
class UUIDSerializer(BaseSerializer):
|
||||
def serialize(self): ...
|
||||
|
||||
def serializer_factory(value: Any) -> BaseSerializer: ...
|
||||
94
django-stubs-generated/db/migrations/state.pyi
Normal file
94
django-stubs-generated/db/migrations/state.pyi
Normal file
@@ -0,0 +1,94 @@
|
||||
from typing import Any, Dict, Iterator, List, Optional, Set, Tuple, Type, Union
|
||||
|
||||
from django.apps.registry import Apps
|
||||
from django.contrib.postgres.fields.citext import CIText
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.fields import Field
|
||||
from django.db.models.indexes import Index
|
||||
from django.db.models.manager import Manager
|
||||
|
||||
|
||||
class AppConfigStub:
|
||||
apps: None
|
||||
label: str
|
||||
models: None
|
||||
models_module: None
|
||||
module: None
|
||||
name: str
|
||||
verbose_name: str
|
||||
def __init__(self, label: str) -> None: ...
|
||||
def import_models(self) -> None: ...
|
||||
|
||||
class ModelState:
|
||||
def __init__(
|
||||
self,
|
||||
app_label: str,
|
||||
name: str,
|
||||
fields: List[Tuple[str, Union[CIText, Field]]],
|
||||
options: Optional[
|
||||
Union[
|
||||
Dict[str, List[Index]],
|
||||
Dict[str, List[str]],
|
||||
Dict[str, Set[Tuple[str, str]]],
|
||||
Dict[str, Tuple[str]],
|
||||
Dict[str, bool],
|
||||
Dict[str, str],
|
||||
]
|
||||
] = ...,
|
||||
bases: Optional[Tuple[Type[Model]]] = ...,
|
||||
managers: Optional[List[Tuple[str, Manager]]] = ...,
|
||||
) -> None: ...
|
||||
def clone(self) -> ModelState: ...
|
||||
def construct_managers(self) -> Iterator[Tuple[str, Manager]]: ...
|
||||
@classmethod
|
||||
def from_model(
|
||||
cls, model: Type[Model], exclude_rels: bool = ...
|
||||
) -> ModelState: ...
|
||||
def get_field_by_name(self, name: str) -> Field: ...
|
||||
@cached_property
|
||||
def name_lower(self) -> str: ...
|
||||
def render(self, apps: StateApps) -> Any: ...
|
||||
|
||||
class ProjectState:
|
||||
is_delayed: bool
|
||||
models: Dict[Any, Any]
|
||||
real_apps: List[str]
|
||||
def __init__(
|
||||
self,
|
||||
models: Optional[Dict[Tuple[str, str], ModelState]] = ...,
|
||||
real_apps: Optional[List[str]] = ...,
|
||||
) -> None: ...
|
||||
def add_model(self, model_state: ModelState) -> None: ...
|
||||
@cached_property
|
||||
def apps(self) -> StateApps: ...
|
||||
def clear_delayed_apps_cache(self) -> None: ...
|
||||
def clone(self) -> ProjectState: ...
|
||||
@property
|
||||
def concrete_apps(self) -> StateApps: ...
|
||||
@classmethod
|
||||
def from_apps(cls, apps: Apps) -> ProjectState: ...
|
||||
def reload_model(
|
||||
self, app_label: str, model_name: str, delay: bool = ...
|
||||
) -> None: ...
|
||||
def reload_models(self, models: List[Any], delay: bool = ...) -> None: ...
|
||||
def remove_model(self, app_label: str, model_name: str) -> None: ...
|
||||
|
||||
class StateApps:
|
||||
all_models: collections.defaultdict
|
||||
app_configs: collections.OrderedDict
|
||||
apps_ready: bool
|
||||
loading: bool
|
||||
models_ready: bool
|
||||
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 bulk_update(self) -> Iterator[None]: ...
|
||||
def clone(self) -> StateApps: ...
|
||||
def render_multiple(self, model_states: List[ModelState]) -> None: ...
|
||||
def unregister_model(self, app_label: str, model_name: str) -> None: ...
|
||||
11
django-stubs-generated/db/migrations/topological_sort.pyi
Normal file
11
django-stubs-generated/db/migrations/topological_sort.pyi
Normal file
@@ -0,0 +1,11 @@
|
||||
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]: ...
|
||||
13
django-stubs-generated/db/migrations/utils.pyi
Normal file
13
django-stubs-generated/db/migrations/utils.pyi
Normal file
@@ -0,0 +1,13 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.utils.functional import SimpleLazyObject
|
||||
|
||||
COMPILED_REGEX_TYPE: Any
|
||||
|
||||
class RegexObject:
|
||||
pattern: str = ...
|
||||
flags: int = ...
|
||||
def __init__(self, obj: SimpleLazyObject) -> None: ...
|
||||
def __eq__(self, other: RegexObject) -> bool: ...
|
||||
|
||||
def get_migration_name_timestamp() -> str: ...
|
||||
41
django-stubs-generated/db/migrations/writer.pyi
Normal file
41
django-stubs-generated/db/migrations/writer.pyi
Normal file
@@ -0,0 +1,41 @@
|
||||
from typing import Any, Optional, Set, Tuple, Type
|
||||
|
||||
from django.db.migrations.migration import Migration
|
||||
from django.db.migrations.operations.base import Operation
|
||||
|
||||
|
||||
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:
|
||||
operation: django.db.migrations.operations.models.CreateModel = ...
|
||||
buff: List[Any] = ...
|
||||
indentation: int = ...
|
||||
def __init__(
|
||||
self, operation: Operation, indentation: int = ...
|
||||
) -> None: ...
|
||||
def serialize(self) -> Tuple[str, Set[str]]: ...
|
||||
def indent(self) -> None: ...
|
||||
def unindent(self) -> None: ...
|
||||
def feed(self, line: str) -> None: ...
|
||||
def render(self) -> str: ...
|
||||
|
||||
class MigrationWriter:
|
||||
migration: django.db.migrations.migration.Migration = ...
|
||||
needs_manual_porting: bool = ...
|
||||
def __init__(self, migration: Migration) -> None: ...
|
||||
def as_string(self) -> str: ...
|
||||
@property
|
||||
def basedir(self) -> str: ...
|
||||
@property
|
||||
def filename(self) -> str: ...
|
||||
@property
|
||||
def path(self) -> str: ...
|
||||
@classmethod
|
||||
def serialize(cls, value: Any) -> Tuple[str, Set[str]]: ...
|
||||
|
||||
MIGRATION_TEMPLATE: str
|
||||
96
django-stubs-generated/db/models/__init__.pyi
Normal file
96
django-stubs-generated/db/models/__init__.pyi
Normal file
@@ -0,0 +1,96 @@
|
||||
# noinspection PyUnresolvedReferences
|
||||
from django.core.exceptions import (
|
||||
ObjectDoesNotExist as ObjectDoesNotExist
|
||||
)
|
||||
|
||||
# noinspection PyUnresolvedReferences
|
||||
from django.db.models import (
|
||||
signals as signals
|
||||
)
|
||||
|
||||
# noinspection PyUnresolvedReferences
|
||||
from django.db.models.aggregates import * # NOQA
|
||||
|
||||
# noinspection PyUnresolvedReferences
|
||||
from django.db.models.aggregates import __all__ as aggregates_all
|
||||
|
||||
# noinspection PyUnresolvedReferences
|
||||
from django.db.models.deletion import (
|
||||
CASCADE as CASCADE,
|
||||
DO_NOTHING as DO_NOTHING,
|
||||
PROTECT as PROTECT,
|
||||
SET as SET,
|
||||
SET_DEFAULT as SET_DEFAULT,
|
||||
SET_NULL as SET_NULL,
|
||||
ProtectedError as ProtectedError,
|
||||
)
|
||||
|
||||
# noinspection PyUnresolvedReferences
|
||||
from django.db.models.expressions import (
|
||||
Case as Case,
|
||||
Exists as Exists,
|
||||
Expression as Expression,
|
||||
ExpressionList as ExpressionList,
|
||||
ExpressionWrapper as ExpressionWrapper,
|
||||
F as F,
|
||||
Func as Func,
|
||||
OuterRef as OuterRef,
|
||||
RowRange as RowRange,
|
||||
Subquery as Subquery,
|
||||
Value as Value,
|
||||
ValueRange as ValueRange,
|
||||
When as When,
|
||||
Window as Window,
|
||||
WindowFrame as WindowFrame,
|
||||
)
|
||||
|
||||
# noinspection PyUnresolvedReferences
|
||||
from django.db.models.fields import * # NOQA
|
||||
|
||||
# noinspection PyUnresolvedReferences
|
||||
from django.db.models.fields.files import (
|
||||
FileField as FileField,
|
||||
ImageField as ImageField
|
||||
)
|
||||
|
||||
# noinspection PyUnresolvedReferences
|
||||
from django.db.models.fields.proxy import OrderWrt
|
||||
|
||||
# noinspection PyUnresolvedReferences
|
||||
from django.db.models.indexes import * # NOQA
|
||||
|
||||
# noinspection PyUnresolvedReferences
|
||||
from django.db.models.lookups import (
|
||||
Lookup as Lookup,
|
||||
Transform as Transform
|
||||
)
|
||||
|
||||
# noinspection PyUnresolvedReferences
|
||||
from django.db.models.manager import Manager as Manager
|
||||
|
||||
# noinspection PyUnresolvedReferences
|
||||
from django.db.models.query import (
|
||||
Prefetch as Prefetch,
|
||||
Q as Q,
|
||||
QuerySet as QuerySet,
|
||||
prefetch_related_objects as prefetch_related_objects,
|
||||
)
|
||||
|
||||
# noinspection PyUnresolvedReferences
|
||||
from django.db.models.query_utils import FilteredRelation as FilteredRelation
|
||||
|
||||
# Imports that would create circular imports if sorted
|
||||
# noinspection PyUnresolvedReferences
|
||||
from django.db.models.base import DEFERRED as DEFERRED, Model as Model # isort:skip
|
||||
|
||||
# noinspection PyUnresolvedReferences
|
||||
from django.db.models.fields.related import ( # isort:skip
|
||||
ForeignKey as ForeignKey,
|
||||
ForeignObject as ForeignObject,
|
||||
OneToOneField as OneToOneField,
|
||||
ManyToManyField as ManyToManyField,
|
||||
ManyToOneRel as ManyToOneRel,
|
||||
ManyToManyRel as ManyToManyRel,
|
||||
OneToOneRel as OneToOneRel
|
||||
)
|
||||
|
||||
105
django-stubs-generated/db/models/aggregates.pyi
Normal file
105
django-stubs-generated/db/models/aggregates.pyi
Normal file
@@ -0,0 +1,105 @@
|
||||
from decimal import Decimal
|
||||
from typing import Any, List, Optional, Tuple, Union
|
||||
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.models.expressions import Combinable, Expression, Func
|
||||
from django.db.models.fields import Field
|
||||
from django.db.models.query_utils import Q
|
||||
from django.db.models.sql.compiler import SQLCompiler
|
||||
from django.db.models.sql.query import Query
|
||||
from django.db.models.sql.where import WhereNode
|
||||
|
||||
|
||||
class Aggregate(Func):
|
||||
contains_aggregate: bool = ...
|
||||
name: Any = ...
|
||||
filter_template: str = ...
|
||||
window_compatible: bool = ...
|
||||
filter: Any = ...
|
||||
def __init__(
|
||||
self, *args: Any, filter: Optional[Any] = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
def get_source_fields(self) -> Union[List[None], List[Field]]: ...
|
||||
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 = ...,
|
||||
) -> Aggregate: ...
|
||||
@property
|
||||
def default_alias(self) -> str: ...
|
||||
def get_group_by_cols(self) -> List[Any]: ...
|
||||
def as_sql(
|
||||
self,
|
||||
compiler: SQLCompiler,
|
||||
connection: DatabaseWrapper,
|
||||
**extra_context: Any
|
||||
) -> Tuple[str, Union[List[Decimal], List[int]]]: ...
|
||||
|
||||
class Avg(Aggregate):
|
||||
filter: None
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
def as_mysql(self, compiler: Any, connection: Any): ...
|
||||
def as_oracle(self, compiler: Any, connection: Any): ...
|
||||
|
||||
class Count(Aggregate):
|
||||
filter: None
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
template: str = ...
|
||||
output_field: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
expression: str,
|
||||
distinct: bool = ...,
|
||||
filter: Optional[Q] = ...,
|
||||
**extra: Any
|
||||
) -> None: ...
|
||||
def convert_value(
|
||||
self,
|
||||
value: Optional[int],
|
||||
expression: Count,
|
||||
connection: DatabaseWrapper,
|
||||
) -> int: ...
|
||||
|
||||
class Max(Aggregate):
|
||||
filter: None
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
|
||||
class Min(Aggregate):
|
||||
filter: None
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
|
||||
class StdDev(Aggregate):
|
||||
filter: None
|
||||
name: str = ...
|
||||
output_field: Any = ...
|
||||
function: str = ...
|
||||
def __init__(
|
||||
self, expression: str, sample: bool = ..., **extra: Any
|
||||
) -> None: ...
|
||||
|
||||
class Sum(Aggregate):
|
||||
filter: None
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
def as_mysql(self, compiler: Any, connection: Any): ...
|
||||
def as_oracle(self, compiler: Any, connection: Any): ...
|
||||
|
||||
class Variance(Aggregate):
|
||||
filter: None
|
||||
name: str = ...
|
||||
output_field: Any = ...
|
||||
function: str = ...
|
||||
def __init__(
|
||||
self, expression: str, sample: bool = ..., **extra: Any
|
||||
) -> None: ...
|
||||
110
django-stubs-generated/db/models/base.pyi
Normal file
110
django-stubs-generated/db/models/base.pyi
Normal file
@@ -0,0 +1,110 @@
|
||||
from datetime import date
|
||||
from decimal import Decimal
|
||||
from typing import Any, Dict, List, Optional, Set, Tuple, Type, Union
|
||||
from uuid import UUID
|
||||
|
||||
from django.core.checks.messages import Warning
|
||||
from django.core.exceptions import ValidationError, ObjectDoesNotExist
|
||||
from django.db.models.fields.related import ForeignKey
|
||||
|
||||
|
||||
class Deferred: ...
|
||||
|
||||
DEFERRED: Any
|
||||
|
||||
def subclass_exception(
|
||||
name: str,
|
||||
bases: Tuple[Type[Exception]],
|
||||
module: str,
|
||||
attached_to: Type[Model],
|
||||
) -> Type[Exception]: ...
|
||||
|
||||
class ModelBase(type):
|
||||
def __new__(
|
||||
cls: Type[ModelBase],
|
||||
name: str,
|
||||
bases: Tuple[Type[Model]],
|
||||
attrs: Dict[str, Any],
|
||||
**kwargs: Any
|
||||
) -> Type[Model]: ...
|
||||
def add_to_class(cls, name: str, value: Any) -> None: ...
|
||||
|
||||
class ModelStateFieldsCacheDescriptor:
|
||||
def __get__(
|
||||
self, instance: ModelState, cls: Type[ModelState] = ...
|
||||
) -> Dict[Any, Any]: ...
|
||||
|
||||
class ModelState:
|
||||
db: Any = ...
|
||||
adding: bool = ...
|
||||
fields_cache: Any = ...
|
||||
|
||||
class Model:
|
||||
class DoesNotExist(ObjectDoesNotExist):
|
||||
pass
|
||||
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
@classmethod
|
||||
def from_db(
|
||||
cls,
|
||||
db: str,
|
||||
field_names: List[str],
|
||||
values: Union[
|
||||
List[Optional[Union[date, int, str]]],
|
||||
List[Optional[UUID]],
|
||||
List[Union[Decimal, int]],
|
||||
List[Union[int, UUID]],
|
||||
Tuple[Union[int, str]],
|
||||
],
|
||||
) -> Model: ...
|
||||
def __eq__(self, other: Any) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __reduce__(self): ...
|
||||
pk: Any = ...
|
||||
def get_deferred_fields(self) -> Set[str]: ...
|
||||
def refresh_from_db(
|
||||
self, using: None = ..., fields: Optional[List[str]] = ...
|
||||
) -> None: ...
|
||||
def serializable_value(self, field_name: str) -> Union[int, str]: ...
|
||||
def save(
|
||||
self,
|
||||
force_insert: bool = ...,
|
||||
force_update: bool = ...,
|
||||
using: Optional[str] = ...,
|
||||
update_fields: Optional[List[str]] = ...,
|
||||
) -> None: ...
|
||||
def save_base(
|
||||
self,
|
||||
raw: bool = ...,
|
||||
force_insert: bool = ...,
|
||||
force_update: bool = ...,
|
||||
using: str = ...,
|
||||
update_fields: Optional[frozenset] = ...,
|
||||
) -> None: ...
|
||||
def delete(
|
||||
self, using: None = ..., keep_parents: bool = ...
|
||||
) -> Tuple[int, Dict[str, int]]: ...
|
||||
def prepare_database_save(self, field: ForeignKey) -> UUID: ...
|
||||
def clean(self) -> None: ...
|
||||
def validate_unique(self, exclude: List[str] = ...) -> None: ...
|
||||
def date_error_message(
|
||||
self, lookup_type: Any, field_name: Any, unique_for: Any
|
||||
): ...
|
||||
def unique_error_message(
|
||||
self, model_class: Type[Model], unique_check: Tuple[str, str]
|
||||
) -> ValidationError: ...
|
||||
def full_clean(
|
||||
self, exclude: Optional[List[str]] = ..., validate_unique: bool = ...
|
||||
) -> None: ...
|
||||
def clean_fields(self, exclude: List[str] = ...) -> None: ...
|
||||
@classmethod
|
||||
def check(cls, **kwargs: Any) -> List[Warning]: ...
|
||||
|
||||
def method_set_order(
|
||||
self, ordered_obj: Any, id_list: Any, using: Optional[Any] = ...
|
||||
) -> None: ...
|
||||
def method_get_order(self, ordered_obj: Any): ...
|
||||
def make_foreign_order_accessors(
|
||||
model: Type[Model], related_model: Type[Model]
|
||||
) -> None: ...
|
||||
def model_unpickle(model_id: Any): ...
|
||||
76
django-stubs-generated/db/models/deletion.pyi
Normal file
76
django-stubs-generated/db/models/deletion.pyi
Normal file
@@ -0,0 +1,76 @@
|
||||
from typing import (Any, Callable, Dict, Iterator, List, Optional, Tuple, Type,
|
||||
Union)
|
||||
|
||||
from django.db import IntegrityError
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.fields.related import ForeignKey
|
||||
from django.db.models.fields.reverse_related import ManyToOneRel
|
||||
from django.db.models.options import Options
|
||||
from django.db.models.query import QuerySet
|
||||
|
||||
|
||||
class ProtectedError(IntegrityError):
|
||||
protected_objects: django.db.models.query.QuerySet = ...
|
||||
def __init__(
|
||||
self, msg: str, protected_objects: Union[List[Model], QuerySet]
|
||||
) -> None: ...
|
||||
|
||||
def CASCADE(
|
||||
collector: Collector, field: ForeignKey, sub_objs: QuerySet, using: str
|
||||
) -> None: ...
|
||||
def PROTECT(
|
||||
collector: Collector, field: ForeignKey, sub_objs: QuerySet, using: str
|
||||
) -> Any: ...
|
||||
def SET(value: Callable) -> Callable: ...
|
||||
def SET_NULL(
|
||||
collector: Collector, field: ForeignKey, sub_objs: QuerySet, using: str
|
||||
) -> None: ...
|
||||
def SET_DEFAULT(
|
||||
collector: Collector, field: ForeignKey, sub_objs: QuerySet, using: str
|
||||
) -> None: ...
|
||||
def DO_NOTHING(
|
||||
collector: Any, field: Any, sub_objs: Any, using: Any
|
||||
) -> None: ...
|
||||
def get_candidate_relations_to_delete(opts: Options) -> Iterator[Any]: ...
|
||||
|
||||
class Collector:
|
||||
using: str = ...
|
||||
data: collections.OrderedDict = ...
|
||||
field_updates: Dict[Any, Any] = ...
|
||||
fast_deletes: List[Any] = ...
|
||||
dependencies: Dict[Any, Any] = ...
|
||||
def __init__(self, using: str) -> None: ...
|
||||
def add(
|
||||
self,
|
||||
objs: Union[List[Model], QuerySet],
|
||||
source: Optional[Type[Model]] = ...,
|
||||
nullable: bool = ...,
|
||||
reverse_dependency: bool = ...,
|
||||
) -> List[Model]: ...
|
||||
def add_field_update(
|
||||
self, field: ForeignKey, value: Optional[int], objs: QuerySet
|
||||
) -> None: ...
|
||||
def can_fast_delete(
|
||||
self,
|
||||
objs: Union[List[Model], QuerySet],
|
||||
from_field: Optional[ForeignKey] = ...,
|
||||
) -> bool: ...
|
||||
def get_del_batches(
|
||||
self, objs: List[Model], field: ForeignKey
|
||||
) -> List[List[Model]]: ...
|
||||
def collect(
|
||||
self,
|
||||
objs: Union[List[Model], QuerySet],
|
||||
source: Optional[Type[Model]] = ...,
|
||||
nullable: bool = ...,
|
||||
collect_related: bool = ...,
|
||||
source_attr: Optional[str] = ...,
|
||||
reverse_dependency: bool = ...,
|
||||
keep_parents: bool = ...,
|
||||
) -> None: ...
|
||||
def related_objects(
|
||||
self, related: ManyToOneRel, objs: List[Model]
|
||||
) -> QuerySet: ...
|
||||
def instances_with_model(self) -> Iterator[Tuple[Type[Model], Model]]: ...
|
||||
def sort(self) -> None: ...
|
||||
def delete(self) -> Tuple[int, Dict[str, int]]: ...
|
||||
536
django-stubs-generated/db/models/expressions.pyi
Normal file
536
django-stubs-generated/db/models/expressions.pyi
Normal file
@@ -0,0 +1,536 @@
|
||||
from collections import OrderedDict
|
||||
from datetime import datetime, timedelta
|
||||
from typing import (Any, Callable, Dict, Iterator, List, Optional, Set, Tuple,
|
||||
Type, Union)
|
||||
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.models.aggregates import Aggregate, Count
|
||||
from django.db.models.fields import Field, DurationField
|
||||
from django.db.models.fields.reverse_related import ForeignObjectRel
|
||||
from django.db.models.functions.window import DenseRank
|
||||
from django.db.models.lookups import (FieldGetDbPrepValueMixin, Lookup,
|
||||
Transform)
|
||||
from django.db.models.query import QuerySet
|
||||
from django.db.models.query_utils import Q
|
||||
from django.db.models.sql.compiler import SQLCompiler
|
||||
from django.db.models.sql.query import Query
|
||||
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]]: ...
|
||||
|
||||
class Combinable:
|
||||
ADD: str = ...
|
||||
SUB: str = ...
|
||||
MUL: str = ...
|
||||
DIV: str = ...
|
||||
POW: str = ...
|
||||
MOD: str = ...
|
||||
BITAND: str = ...
|
||||
BITOR: str = ...
|
||||
BITLEFTSHIFT: str = ...
|
||||
BITRIGHTSHIFT: str = ...
|
||||
def __neg__(self) -> CombinedExpression: ...
|
||||
def __add__(
|
||||
self, other: Optional[Union[timedelta, Combinable, float, str]]
|
||||
) -> CombinedExpression: ...
|
||||
def __sub__(
|
||||
self, other: Union[timedelta, Combinable, float]
|
||||
) -> CombinedExpression: ...
|
||||
def __mul__(
|
||||
self, other: Union[timedelta, Combinable, float]
|
||||
) -> CombinedExpression: ...
|
||||
def __truediv__(self, other: Union[Count, float]) -> CombinedExpression: ...
|
||||
def __mod__(self, other: int) -> CombinedExpression: ...
|
||||
def __pow__(self, other: float) -> CombinedExpression: ...
|
||||
def __and__(self, other: Combinable) -> Any: ...
|
||||
def bitand(self, other: int) -> CombinedExpression: ...
|
||||
def bitleftshift(self, other: int) -> CombinedExpression: ...
|
||||
def bitrightshift(self, other: int) -> CombinedExpression: ...
|
||||
def __or__(self, other: Combinable) -> Any: ...
|
||||
def bitor(self, other: int) -> CombinedExpression: ...
|
||||
def __radd__(
|
||||
self, other: Optional[Union[datetime, float]]
|
||||
) -> CombinedExpression: ...
|
||||
def __rsub__(self, other: float) -> CombinedExpression: ...
|
||||
def __rmul__(self, other: float) -> CombinedExpression: ...
|
||||
def __rtruediv__(self, other: float) -> CombinedExpression: ...
|
||||
def __rmod__(self, other: int) -> CombinedExpression: ...
|
||||
def __rpow__(self, other: float) -> CombinedExpression: ...
|
||||
def __rand__(self, other: Any) -> Any: ...
|
||||
def __ror__(self, other: Any) -> Any: ...
|
||||
|
||||
class BaseExpression:
|
||||
is_summary: bool = ...
|
||||
filterable: bool = ...
|
||||
window_compatible: bool = ...
|
||||
output_field: Any = ...
|
||||
def __init__(
|
||||
self, output_field: Optional[Union[Field, ForeignObjectRel, str]] = ...
|
||||
) -> None: ...
|
||||
def get_db_converters(
|
||||
self, connection: DatabaseWrapper
|
||||
) -> List[Callable]: ...
|
||||
def get_source_expressions(self) -> List[Any]: ...
|
||||
def set_source_expressions(self, exprs: List[Any]) -> None: ...
|
||||
def as_sql(self, compiler: Any, connection: Any) -> None: ...
|
||||
def contains_aggregate(self) -> bool: ...
|
||||
def contains_over_clause(self) -> bool: ...
|
||||
def contains_column_references(self) -> bool: ...
|
||||
def resolve_expression(
|
||||
self,
|
||||
query: Query = ...,
|
||||
allow_joins: bool = ...,
|
||||
reuse: Optional[Set[str]] = ...,
|
||||
summarize: bool = ...,
|
||||
for_save: bool = ...,
|
||||
) -> BaseExpression: ...
|
||||
@property
|
||||
def field(self) -> Field: ...
|
||||
def output_field(self) -> Field: ...
|
||||
def convert_value(self) -> Callable: ...
|
||||
def get_lookup(
|
||||
self, lookup: str
|
||||
) -> Optional[Type[Union[FieldGetDbPrepValueMixin, Lookup]]]: ...
|
||||
def get_transform(self, name: str) -> Optional[Type[Transform]]: ...
|
||||
def relabeled_clone(
|
||||
self, change_map: Union[Dict[Optional[str], str], OrderedDict]
|
||||
) -> Expression: ...
|
||||
def copy(self) -> BaseExpression: ...
|
||||
def get_group_by_cols(self) -> List[Expression]: ...
|
||||
def get_source_fields(self) -> List[Optional[Field]]: ...
|
||||
def asc(self, **kwargs: Any) -> OrderBy: ...
|
||||
def desc(self, **kwargs: Any) -> OrderBy: ...
|
||||
def reverse_ordering(self): ...
|
||||
def flatten(self) -> Iterator[Expression]: ...
|
||||
def __eq__(self, other: Combinable) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
class Expression(BaseExpression, Combinable): ...
|
||||
|
||||
class CombinedExpression(SQLiteNumericMixin, Expression):
|
||||
connector: Any = ...
|
||||
lhs: Any = ...
|
||||
rhs: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
lhs: Combinable,
|
||||
connector: str,
|
||||
rhs: Combinable,
|
||||
output_field: None = ...,
|
||||
) -> None: ...
|
||||
def get_source_expressions(
|
||||
self
|
||||
) -> Union[List[Combinable], List[SQLiteNumericMixin]]: ...
|
||||
def set_source_expressions(self, exprs: List[Combinable]) -> None: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[float]]: ...
|
||||
def resolve_expression(
|
||||
self,
|
||||
query: Query = ...,
|
||||
allow_joins: bool = ...,
|
||||
reuse: Optional[Set[str]] = ...,
|
||||
summarize: bool = ...,
|
||||
for_save: bool = ...,
|
||||
) -> CombinedExpression: ...
|
||||
|
||||
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]]]: ...
|
||||
|
||||
class TemporalSubtraction(CombinedExpression):
|
||||
output_field: Any = ...
|
||||
def __init__(self, lhs: Col, rhs: Expression) -> None: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[str]]: ...
|
||||
|
||||
class F(Combinable):
|
||||
filterable: bool = ...
|
||||
name: str = ...
|
||||
def __init__(self, name: Union[OuterRef, str]) -> None: ...
|
||||
def resolve_expression(
|
||||
self,
|
||||
query: Query = ...,
|
||||
allow_joins: bool = ...,
|
||||
reuse: Optional[Set[str]] = ...,
|
||||
summarize: bool = ...,
|
||||
for_save: bool = ...,
|
||||
) -> Expression: ...
|
||||
def asc(self, **kwargs: Any) -> OrderBy: ...
|
||||
def desc(self, **kwargs: Any) -> OrderBy: ...
|
||||
def __eq__(self, other: Combinable) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
class ResolvedOuterRef(F):
|
||||
name: str
|
||||
def as_sql(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
def relabeled_clone(self, relabels: OrderedDict) -> ResolvedOuterRef: ...
|
||||
|
||||
class OuterRef(F):
|
||||
name: str
|
||||
def resolve_expression(
|
||||
self,
|
||||
query: Query = ...,
|
||||
allow_joins: bool = ...,
|
||||
reuse: Optional[Set[str]] = ...,
|
||||
summarize: bool = ...,
|
||||
for_save: bool = ...,
|
||||
) -> F: ...
|
||||
|
||||
class Func(SQLiteNumericMixin, Expression):
|
||||
function: Any = ...
|
||||
template: str = ...
|
||||
arg_joiner: str = ...
|
||||
arity: Any = ...
|
||||
source_expressions: Any = ...
|
||||
extra: Any = ...
|
||||
def __init__(
|
||||
self, *expressions: Any, output_field: Optional[Any] = ..., **extra: Any
|
||||
) -> None: ...
|
||||
def get_source_expressions(self) -> List[Combinable]: ...
|
||||
def set_source_expressions(self, exprs: List[Expression]) -> None: ...
|
||||
def resolve_expression(
|
||||
self,
|
||||
query: Query = ...,
|
||||
allow_joins: bool = ...,
|
||||
reuse: Optional[Set[Any]] = ...,
|
||||
summarize: bool = ...,
|
||||
for_save: bool = ...,
|
||||
) -> Func: ...
|
||||
def as_sql(
|
||||
self,
|
||||
compiler: SQLCompiler,
|
||||
connection: DatabaseWrapper,
|
||||
function: Optional[str] = ...,
|
||||
template: Optional[str] = ...,
|
||||
arg_joiner: Optional[str] = ...,
|
||||
**extra_context: Any
|
||||
) -> Tuple[str, List[float]]: ...
|
||||
def copy(self) -> Func: ...
|
||||
|
||||
class Value(Expression):
|
||||
value: Any = ...
|
||||
def __init__(
|
||||
self, value: Any, output_field: Optional[Field] = ...
|
||||
) -> None: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[float]]: ...
|
||||
def resolve_expression(
|
||||
self,
|
||||
query: Query = ...,
|
||||
allow_joins: bool = ...,
|
||||
reuse: Optional[Set[str]] = ...,
|
||||
summarize: bool = ...,
|
||||
for_save: bool = ...,
|
||||
) -> Value: ...
|
||||
def get_group_by_cols(self) -> List[Any]: ...
|
||||
|
||||
class DurationValue(Value):
|
||||
output_field: DurationField
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Any]]: ...
|
||||
|
||||
class RawSQL(Expression):
|
||||
output_field: Field
|
||||
params: List[Any]
|
||||
sql: str
|
||||
def __init__(
|
||||
self,
|
||||
sql: str,
|
||||
params: Union[List[int], List[str], Tuple],
|
||||
output_field: None = ...,
|
||||
) -> None: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[str]]: ...
|
||||
def get_group_by_cols(self) -> List[RawSQL]: ...
|
||||
def __hash__(self): ...
|
||||
|
||||
class Star(Expression):
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Any]]: ...
|
||||
|
||||
class Random(Expression):
|
||||
output_field: Any = ...
|
||||
def as_sql(self, compiler: Any, connection: Any): ...
|
||||
|
||||
class Col(Expression):
|
||||
output_field: Field
|
||||
contains_column_references: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
alias: str,
|
||||
target: Union[Field, str],
|
||||
output_field: Optional[Field] = ...,
|
||||
) -> None: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Any]]: ...
|
||||
def relabeled_clone(
|
||||
self, relabels: Union[Dict[str, str], OrderedDict]
|
||||
) -> Col: ...
|
||||
def get_group_by_cols(self) -> List[Col]: ...
|
||||
def get_db_converters(
|
||||
self, connection: DatabaseWrapper
|
||||
) -> List[Callable]: ...
|
||||
|
||||
class Ref(Expression):
|
||||
def __init__(self, refs: str, source: Expression) -> None: ...
|
||||
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 = ...,
|
||||
) -> Ref: ...
|
||||
def relabeled_clone(self, relabels: Dict[Optional[str], str]) -> Ref: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Any]]: ...
|
||||
def get_group_by_cols(self): ...
|
||||
|
||||
class ExpressionList(Func):
|
||||
template: str = ...
|
||||
def __init__(self, *expressions: Any, **extra: Any) -> None: ...
|
||||
|
||||
class ExpressionWrapper(Expression):
|
||||
expression: Any = ...
|
||||
def __init__(
|
||||
self, expression: Union[CombinedExpression, Q], output_field: Field
|
||||
) -> None: ...
|
||||
def set_source_expressions(
|
||||
self, exprs: Union[List[CombinedExpression], List[WhereNode]]
|
||||
) -> None: ...
|
||||
def get_source_expressions(
|
||||
self
|
||||
) -> Union[List[CombinedExpression], List[Node]]: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Any]]: ...
|
||||
|
||||
class When(Expression):
|
||||
template: str = ...
|
||||
condition: Any = ...
|
||||
result: Any = ...
|
||||
def __init__(
|
||||
self, condition: Any = ..., then: Any = ..., **lookups: Any
|
||||
) -> None: ...
|
||||
def get_source_expressions(self) -> List[Union[Expression, WhereNode]]: ...
|
||||
def set_source_expressions(
|
||||
self, exprs: List[Union[Expression, WhereNode]]
|
||||
) -> None: ...
|
||||
def get_source_fields(self) -> Union[List[None], List[Field]]: ...
|
||||
def resolve_expression(
|
||||
self,
|
||||
query: Query = ...,
|
||||
allow_joins: bool = ...,
|
||||
reuse: Optional[Set[str]] = ...,
|
||||
summarize: bool = ...,
|
||||
for_save: bool = ...,
|
||||
) -> When: ...
|
||||
def as_sql(
|
||||
self,
|
||||
compiler: SQLCompiler,
|
||||
connection: DatabaseWrapper,
|
||||
template: None = ...,
|
||||
**extra_context: Any
|
||||
) -> Tuple[str, List[Union[int, str]]]: ...
|
||||
def get_group_by_cols(self) -> List[Col]: ...
|
||||
|
||||
class Case(Expression):
|
||||
template: str = ...
|
||||
case_joiner: str = ...
|
||||
cases: Any = ...
|
||||
default: Any = ...
|
||||
extra: Any = ...
|
||||
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(
|
||||
self,
|
||||
query: Query = ...,
|
||||
allow_joins: bool = ...,
|
||||
reuse: Optional[Set[Any]] = ...,
|
||||
summarize: bool = ...,
|
||||
for_save: bool = ...,
|
||||
) -> Case: ...
|
||||
def copy(self) -> Case: ...
|
||||
def as_sql(
|
||||
self,
|
||||
compiler: SQLCompiler,
|
||||
connection: DatabaseWrapper,
|
||||
template: None = ...,
|
||||
case_joiner: None = ...,
|
||||
**extra_context: Any
|
||||
) -> Tuple[str, List[Union[int, str]]]: ...
|
||||
|
||||
class Subquery(Expression):
|
||||
template: str = ...
|
||||
queryset: QuerySet = ...
|
||||
extra: Dict[Any, Any] = ...
|
||||
def __init__(
|
||||
self,
|
||||
queryset: QuerySet,
|
||||
output_field: Optional[Field] = ...,
|
||||
**extra: Any
|
||||
) -> None: ...
|
||||
def copy(self) -> Subquery: ...
|
||||
def resolve_expression(
|
||||
self,
|
||||
query: Query = ...,
|
||||
allow_joins: bool = ...,
|
||||
reuse: Optional[Set[Any]] = ...,
|
||||
summarize: bool = ...,
|
||||
for_save: bool = ...,
|
||||
) -> Subquery: ...
|
||||
def get_source_expressions(self) -> List[Col]: ...
|
||||
def relabeled_clone(self, change_map: OrderedDict) -> Subquery: ...
|
||||
def as_sql(
|
||||
self,
|
||||
compiler: SQLCompiler,
|
||||
connection: DatabaseWrapper,
|
||||
template: None = ...,
|
||||
**extra_context: Any
|
||||
) -> Tuple[str, Tuple]: ...
|
||||
|
||||
class Exists(Subquery):
|
||||
extra: Dict[Any, Any]
|
||||
template: str = ...
|
||||
negated: bool = ...
|
||||
def __init__(
|
||||
self, *args: Any, negated: bool = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
def __invert__(self) -> Exists: ...
|
||||
def resolve_expression(
|
||||
self, query: Query = ..., *args: Any, **kwargs: Any
|
||||
) -> Exists: ...
|
||||
def as_sql(
|
||||
self,
|
||||
compiler: SQLCompiler,
|
||||
connection: DatabaseWrapper,
|
||||
template: None = ...,
|
||||
**extra_context: Any
|
||||
) -> Tuple[str, Tuple]: ...
|
||||
def as_oracle(
|
||||
self,
|
||||
compiler: Any,
|
||||
connection: Any,
|
||||
template: Optional[Any] = ...,
|
||||
**extra_context: Any
|
||||
): ...
|
||||
|
||||
class OrderBy(BaseExpression):
|
||||
template: str = ...
|
||||
nulls_first: bool = ...
|
||||
nulls_last: bool = ...
|
||||
descending: bool = ...
|
||||
expression: Expression = ...
|
||||
def __init__(
|
||||
self,
|
||||
expression: Combinable,
|
||||
descending: bool = ...,
|
||||
nulls_first: bool = ...,
|
||||
nulls_last: bool = ...,
|
||||
) -> None: ...
|
||||
def set_source_expressions(self, exprs: List[Expression]) -> None: ...
|
||||
def get_source_expressions(self) -> List[Combinable]: ...
|
||||
def as_sql(
|
||||
self,
|
||||
compiler: SQLCompiler,
|
||||
connection: DatabaseWrapper,
|
||||
template: Optional[str] = ...,
|
||||
**extra_context: Any
|
||||
) -> Tuple[str, List[Union[int, str]]]: ...
|
||||
def as_sqlite(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Union[int, str]]]: ...
|
||||
def as_mysql(self, compiler: Any, connection: Any): ...
|
||||
def get_group_by_cols(self): ...
|
||||
def reverse_ordering(self) -> OrderBy: ...
|
||||
def asc(self) -> None: ...
|
||||
def desc(self) -> None: ...
|
||||
|
||||
class Window(Expression):
|
||||
template: str = ...
|
||||
contains_aggregate: bool = ...
|
||||
contains_over_clause: bool = ...
|
||||
filterable: bool = ...
|
||||
partition_by: None = ...
|
||||
order_by: None = ...
|
||||
frame: None = ...
|
||||
source_expression: Expression = ...
|
||||
def __init__(
|
||||
self,
|
||||
expression: Aggregate,
|
||||
partition_by: Optional[str] = ...,
|
||||
order_by: Optional[Union[OrderBy, str]] = ...,
|
||||
frame: None = ...,
|
||||
output_field: None = ...,
|
||||
) -> None: ...
|
||||
def get_source_expressions(self): ...
|
||||
def set_source_expressions(
|
||||
self, exprs: List[Optional[DenseRank]]
|
||||
) -> None: ...
|
||||
def as_sql(
|
||||
self,
|
||||
compiler: Any,
|
||||
connection: Any,
|
||||
function: Optional[Any] = ...,
|
||||
template: Optional[Any] = ...,
|
||||
): ...
|
||||
def get_group_by_cols(self) -> List[Any]: ...
|
||||
|
||||
class WindowFrame(Expression):
|
||||
template: str = ...
|
||||
start: None = ...
|
||||
end: None = ...
|
||||
def __init__(self, start: int = ..., end: Optional[int] = ...) -> None: ...
|
||||
def set_source_expressions(self, exprs: Any) -> None: ...
|
||||
def get_source_expressions(self): ...
|
||||
def as_sql(self, compiler: Any, connection: Any): ...
|
||||
def get_group_by_cols(self) -> List[Any]: ...
|
||||
def window_frame_start_end(
|
||||
self, connection: Any, start: Any, end: Any
|
||||
) -> None: ...
|
||||
|
||||
class RowRange(WindowFrame):
|
||||
end: None
|
||||
start: int
|
||||
frame_type: str = ...
|
||||
def window_frame_start_end(self, connection: Any, start: Any, end: Any): ...
|
||||
|
||||
class ValueRange(WindowFrame):
|
||||
end: int
|
||||
start: None
|
||||
frame_type: str = ...
|
||||
def window_frame_start_end(self, connection: Any, start: Any, end: Any): ...
|
||||
573
django-stubs-generated/db/models/fields/__init__.pyi
Normal file
573
django-stubs-generated/db/models/fields/__init__.pyi
Normal file
@@ -0,0 +1,573 @@
|
||||
from datetime import date, datetime, time, timedelta
|
||||
from decimal import Context, Decimal
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
from uuid import UUID
|
||||
|
||||
from django.core.validators import DecimalValidator
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.expressions import Col, CombinedExpression
|
||||
from django.db.models.fields import reverse_related
|
||||
from django.db.models.fields.files import FieldFile
|
||||
from django.db.models.fields.reverse_related import ForeignObjectRel
|
||||
from django.db.models.query import QuerySet
|
||||
from django.db.models.query_utils import RegisterLookupMixin
|
||||
from django.db.models.sql.compiler import SQLCompiler, SQLInsertCompiler
|
||||
from django.forms.fields import (BooleanField, DurationField, EmailField,
|
||||
Field, FloatField, TypedMultipleChoiceField)
|
||||
from django.utils.datastructures import DictWrapper
|
||||
|
||||
|
||||
class Empty: ...
|
||||
class NOT_PROVIDED: ...
|
||||
|
||||
BLANK_CHOICE_DASH: Any
|
||||
|
||||
class Field(RegisterLookupMixin):
|
||||
empty_strings_allowed: bool = ...
|
||||
empty_values: Any = ...
|
||||
creation_counter: int = ...
|
||||
auto_creation_counter: int = ...
|
||||
default_validators: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
system_check_deprecated_details: Any = ...
|
||||
system_check_removed_details: Any = ...
|
||||
hidden: bool = ...
|
||||
many_to_many: Any = ...
|
||||
many_to_one: Any = ...
|
||||
one_to_many: Any = ...
|
||||
one_to_one: Any = ...
|
||||
related_model: Any = ...
|
||||
description: Any = ...
|
||||
name: Any = ...
|
||||
verbose_name: Any = ...
|
||||
primary_key: Any = ...
|
||||
remote_field: Any = ...
|
||||
is_relation: Any = ...
|
||||
default: Any = ...
|
||||
editable: Any = ...
|
||||
serialize: Any = ...
|
||||
unique_for_date: Any = ...
|
||||
unique_for_month: Any = ...
|
||||
unique_for_year: Any = ...
|
||||
choices: Any = ...
|
||||
help_text: Any = ...
|
||||
db_index: Any = ...
|
||||
db_column: Any = ...
|
||||
auto_created: Any = ...
|
||||
error_messages: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: Optional[str] = ...,
|
||||
name: Optional[str] = ...,
|
||||
primary_key: bool = ...,
|
||||
max_length: Optional[int] = ...,
|
||||
unique: bool = ...,
|
||||
blank: bool = ...,
|
||||
null: bool = ...,
|
||||
db_index: bool = ...,
|
||||
rel: Optional[ForeignObjectRel] = ...,
|
||||
default: Any = ...,
|
||||
editable: bool = ...,
|
||||
serialize: bool = ...,
|
||||
unique_for_date: None = ...,
|
||||
unique_for_month: None = ...,
|
||||
unique_for_year: None = ...,
|
||||
choices: Optional[
|
||||
Union[
|
||||
List[List[Union[List[List[str]], str]]],
|
||||
List[Tuple[Optional[int], str]],
|
||||
List[Tuple[Union[int, str], int]],
|
||||
Tuple[Tuple[Union[int, str], Union[int, str]]],
|
||||
]
|
||||
] = ...,
|
||||
help_text: str = ...,
|
||||
db_column: Optional[str] = ...,
|
||||
db_tablespace: Optional[str] = ...,
|
||||
auto_created: bool = ...,
|
||||
validators: Union[List[Callable], Tuple] = ...,
|
||||
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 cached_col(self) -> Col: ...
|
||||
def select_format(
|
||||
self, compiler: SQLCompiler, sql: str, params: List[Union[int, str]]
|
||||
) -> Tuple[str, List[Union[int, str]]]: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[
|
||||
Optional[str], str, List[Any], Dict[str, List[Tuple[int, str]]]
|
||||
]: ...
|
||||
def clone(self) -> Field: ...
|
||||
def __eq__(self, other: Field) -> bool: ...
|
||||
def __lt__(self, other: Field) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __deepcopy__(self, memodict: Dict[int, Dict[Any, Any]]) -> Field: ...
|
||||
def __copy__(self) -> Field: ...
|
||||
def __reduce__(self): ...
|
||||
def get_pk_value_on_save(self, instance: Model) -> Optional[UUID]: ...
|
||||
def to_python(self, value: FieldFile) -> FieldFile: ...
|
||||
def validators(self) -> List[Callable]: ...
|
||||
def run_validators(self, value: Any) -> None: ...
|
||||
def validate(self, value: Any, model_instance: Optional[Model]) -> None: ...
|
||||
def clean(self, value: Any, model_instance: Optional[Model]) -> Any: ...
|
||||
def db_type_parameters(
|
||||
self, connection: DatabaseWrapper
|
||||
) -> DictWrapper: ...
|
||||
def db_check(self, connection: DatabaseWrapper) -> None: ...
|
||||
def db_type(self, connection: DatabaseWrapper) -> str: ...
|
||||
def rel_db_type(self, connection: DatabaseWrapper) -> str: ...
|
||||
def cast_db_type(self, connection: Any): ...
|
||||
def db_parameters(
|
||||
self, connection: DatabaseWrapper
|
||||
) -> Dict[str, Optional[str]]: ...
|
||||
def db_type_suffix(self, connection: DatabaseWrapper) -> Optional[str]: ...
|
||||
def get_db_converters(
|
||||
self, connection: DatabaseWrapper
|
||||
) -> List[Callable]: ...
|
||||
@property
|
||||
def unique(self) -> bool: ...
|
||||
@property
|
||||
def db_tablespace(self) -> str: ...
|
||||
concrete: Any = ...
|
||||
def set_attributes_from_name(self, name: str) -> None: ...
|
||||
model: Any = ...
|
||||
def contribute_to_class(
|
||||
self, cls: Type[Model], name: str, private_only: bool = ...
|
||||
) -> None: ...
|
||||
def get_filter_kwargs_for_object(self, obj: Any): ...
|
||||
def get_attname(self) -> str: ...
|
||||
def get_attname_column(self) -> Tuple[str, str]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def pre_save(self, model_instance: Model, add: bool) -> Any: ...
|
||||
def get_prep_value(self, value: Any) -> Any: ...
|
||||
def get_db_prep_value(
|
||||
self, value: Any, connection: DatabaseWrapper, prepared: bool = ...
|
||||
) -> Optional[Union[bytes, float, str]]: ...
|
||||
def get_db_prep_save(
|
||||
self, value: Any, connection: DatabaseWrapper
|
||||
) -> Optional[Union[float, str]]: ...
|
||||
def has_default(self) -> bool: ...
|
||||
def get_default(self) -> Any: ...
|
||||
def get_choices(
|
||||
self,
|
||||
include_blank: bool = ...,
|
||||
blank_choice: List[Tuple[str, str]] = ...,
|
||||
limit_choices_to: Optional[Dict[str, QuerySet]] = ...,
|
||||
) -> List[
|
||||
Tuple[
|
||||
Union[int, str], Union[Tuple[Tuple[str, str], Tuple[str, str]], str]
|
||||
]
|
||||
]: ...
|
||||
def value_to_string(self, obj: Model) -> str: ...
|
||||
flatchoices: Any = ...
|
||||
def save_form_data(
|
||||
self, instance: Model, data: Optional[Union[date, Model, float, str]]
|
||||
) -> None: ...
|
||||
def formfield(
|
||||
self,
|
||||
form_class: Optional[Type[Field]] = ...,
|
||||
choices_form_class: Optional[Type[TypedMultipleChoiceField]] = ...,
|
||||
**kwargs: Any
|
||||
) -> Field: ...
|
||||
def value_from_object(self, obj: Model) -> Any: ...
|
||||
|
||||
class AutoField(Field):
|
||||
description: Any = ...
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[Optional[str], str, List[Any], Dict[str, Union[bool, str]]]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
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_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: ...
|
||||
def __get__(self, instance, owner) -> int: ...
|
||||
|
||||
class BigAutoField(AutoField):
|
||||
description: Any = ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def rel_db_type(self, connection: DatabaseWrapper) -> str: ...
|
||||
|
||||
class BooleanField(Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(self, value: Optional[Union[bool, str]]) -> bool: ...
|
||||
def get_prep_value(
|
||||
self, value: Optional[Union[bool, str]]
|
||||
) -> Optional[bool]: ...
|
||||
def formfield(self, **kwargs: Any) -> BooleanField: ...
|
||||
|
||||
class CharField(Field):
|
||||
description: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def cast_db_type(self, connection: Any): ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[Model, int, str]]
|
||||
) -> Optional[str]: ...
|
||||
def get_prep_value(
|
||||
self, value: Optional[Union[Model, str]]
|
||||
) -> Optional[str]: ...
|
||||
def formfield(self, **kwargs: Any) -> Field: ...
|
||||
def __get__(self, instance, owner) -> str: ...
|
||||
|
||||
class CommaSeparatedIntegerField(CharField):
|
||||
default_validators: Any = ...
|
||||
description: Any = ...
|
||||
system_check_removed_details: Any = ...
|
||||
|
||||
class DateTimeCheckMixin:
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
|
||||
class DateField(DateTimeCheckMixin, Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
def __init__(
|
||||
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: ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[date, str]]
|
||||
) -> Optional[date]: ...
|
||||
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 value_to_string(self, obj: Model) -> str: ...
|
||||
def formfield(self, **kwargs: Any) -> Field: ...
|
||||
|
||||
class DateTimeField(DateField):
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[datetime, str]]
|
||||
) -> Optional[datetime]: ...
|
||||
def pre_save(
|
||||
self, model_instance: Model, add: bool
|
||||
) -> Optional[Union[datetime, CombinedExpression]]: ...
|
||||
def get_prep_value(
|
||||
self, value: Optional[datetime]
|
||||
) -> Optional[datetime]: ...
|
||||
def get_db_prep_value(
|
||||
self,
|
||||
value: Optional[datetime],
|
||||
connection: DatabaseWrapper,
|
||||
prepared: bool = ...,
|
||||
) -> Optional[str]: ...
|
||||
def value_to_string(self, obj: Model) -> str: ...
|
||||
def formfield(self, **kwargs: Any) -> Field: ...
|
||||
|
||||
class DecimalField(Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: None = ...,
|
||||
name: None = ...,
|
||||
max_digits: Optional[int] = ...,
|
||||
decimal_places: Optional[int] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def validators(self) -> List[DecimalValidator]: ...
|
||||
def context(self) -> Context: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[Optional[str], str, List[Any], Dict[str, int]]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(self, value: Optional[str]) -> Optional[Decimal]: ...
|
||||
def get_db_prep_save(
|
||||
self, value: Optional[str], connection: DatabaseWrapper
|
||||
) -> Optional[str]: ...
|
||||
def get_prep_value(self, value: None) -> None: ...
|
||||
def formfield(self, **kwargs: Any): ...
|
||||
|
||||
class DurationField(Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(self, value: str) -> timedelta: ...
|
||||
def get_db_prep_value(
|
||||
self, value: Any, connection: Any, prepared: bool = ...
|
||||
): ...
|
||||
def get_db_converters(self, connection: Any): ...
|
||||
def value_to_string(self, obj: Model) -> str: ...
|
||||
def formfield(self, **kwargs: Any) -> DurationField: ...
|
||||
|
||||
class EmailField(CharField):
|
||||
default_validators: Any = ...
|
||||
description: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[Optional[str], str, List[Any], Dict[str, int]]: ...
|
||||
def formfield(self, **kwargs: Any) -> EmailField: ...
|
||||
|
||||
class FilePathField(Field):
|
||||
description: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: Optional[Any] = ...,
|
||||
name: Optional[Any] = ...,
|
||||
path: str = ...,
|
||||
match: Optional[Any] = ...,
|
||||
recursive: bool = ...,
|
||||
allow_files: bool = ...,
|
||||
allow_folders: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def check(self, **kwargs: Any): ...
|
||||
def deconstruct(self): ...
|
||||
def get_prep_value(self, value: Optional[str]) -> Optional[str]: ...
|
||||
def get_internal_type(self): ...
|
||||
|
||||
class FloatField(Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
def get_prep_value(self, value: Union[float, str]) -> float: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(self, value: Union[float, str]) -> float: ...
|
||||
def formfield(self, **kwargs: Any) -> FloatField: ...
|
||||
|
||||
class IntegerField(Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def validators(self) -> List[Any]: ...
|
||||
def get_prep_value(
|
||||
self, value: Optional[Union[int, str]]
|
||||
) -> Optional[int]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(self, value: Union[int, str]) -> int: ...
|
||||
|
||||
class BigIntegerField(IntegerField):
|
||||
empty_strings_allowed: bool = ...
|
||||
description: Any = ...
|
||||
MAX_BIGINT: int = ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
|
||||
class IPAddressField(Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
description: Any = ...
|
||||
system_check_removed_details: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def deconstruct(self) -> Tuple[None, str, List[Any], Dict[str, bool]]: ...
|
||||
def get_prep_value(self, value: Any): ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
|
||||
class GenericIPAddressField(Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
description: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
unpack_ipv4: Any = ...
|
||||
protocol: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: Optional[Any] = ...,
|
||||
name: Optional[Any] = ...,
|
||||
protocol: str = ...,
|
||||
unpack_ipv4: bool = ...,
|
||||
*args: Any,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def check(self, **kwargs: Any): ...
|
||||
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_prep_value(self, value: Optional[str]) -> Optional[str]: ...
|
||||
|
||||
class NullBooleanField(BooleanField):
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def deconstruct(self): ...
|
||||
def get_internal_type(self): ...
|
||||
|
||||
class PositiveIntegerRelDbTypeMixin:
|
||||
def rel_db_type(self, connection: Any): ...
|
||||
|
||||
class PositiveIntegerField(PositiveIntegerRelDbTypeMixin, IntegerField):
|
||||
description: Any = ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
|
||||
class PositiveSmallIntegerField(PositiveIntegerRelDbTypeMixin, IntegerField):
|
||||
description: Any = ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
|
||||
class SlugField(CharField):
|
||||
default_validators: Any = ...
|
||||
description: Any = ...
|
||||
allow_unicode: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
*args: Any,
|
||||
max_length: int = ...,
|
||||
db_index: bool = ...,
|
||||
allow_unicode: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[Optional[str], str, List[Any], Dict[str, int]]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
|
||||
class SmallIntegerField(IntegerField):
|
||||
description: Any = ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
|
||||
class TextField(Field):
|
||||
description: Any = ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[Dict[Any, Any], int, str]]
|
||||
) -> Optional[str]: ...
|
||||
def get_prep_value(
|
||||
self, value: Optional[Union[Dict[Any, Any], int, str]]
|
||||
) -> Optional[str]: ...
|
||||
|
||||
class TimeField(DateTimeCheckMixin, Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: None = ...,
|
||||
name: None = ...,
|
||||
auto_now: bool = ...,
|
||||
auto_now_add: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[Optional[str], str, List[Any], Dict[Any, Any]]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[datetime, str]]
|
||||
) -> Optional[time]: ...
|
||||
def pre_save(
|
||||
self, model_instance: Model, add: bool
|
||||
) -> Optional[datetime]: ...
|
||||
def get_prep_value(self, value: Optional[datetime]) -> Optional[time]: ...
|
||||
def get_db_prep_value(
|
||||
self,
|
||||
value: Optional[datetime],
|
||||
connection: DatabaseWrapper,
|
||||
prepared: bool = ...,
|
||||
) -> Optional[str]: ...
|
||||
def value_to_string(self, obj: Any): ...
|
||||
|
||||
class URLField(CharField):
|
||||
default_validators: Any = ...
|
||||
description: Any = ...
|
||||
def __init__(
|
||||
self, verbose_name: None = ..., name: None = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[Optional[str], str, List[Any], Dict[str, int]]: ...
|
||||
|
||||
class BinaryField(Field):
|
||||
description: Any = ...
|
||||
empty_values: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[Optional[str], str, List[Any], Dict[str, bool]]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def get_placeholder(
|
||||
self,
|
||||
value: None,
|
||||
compiler: SQLInsertCompiler,
|
||||
connection: DatabaseWrapper,
|
||||
) -> str: ...
|
||||
def get_default(self) -> bytes: ...
|
||||
def get_db_prep_value(
|
||||
self,
|
||||
value: Optional[bytes],
|
||||
connection: DatabaseWrapper,
|
||||
prepared: bool = ...,
|
||||
) -> None: ...
|
||||
def value_to_string(self, obj: Any): ...
|
||||
def to_python(self, value: Any): ...
|
||||
|
||||
class UUIDField(Field):
|
||||
default_error_messages: Any = ...
|
||||
description: str = ...
|
||||
empty_strings_allowed: bool = ...
|
||||
def __init__(self, verbose_name: None = ..., **kwargs: Any) -> None: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[
|
||||
Optional[str], str, List[Any], Dict[str, Union[Callable, bool]]
|
||||
]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def get_db_prep_value(
|
||||
self,
|
||||
value: Optional[Union[Dict[Any, Any], List[Any]]],
|
||||
connection: DatabaseWrapper,
|
||||
prepared: bool = ...,
|
||||
) -> None: ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[Dict[Any, Any], List[Any], UUID]]
|
||||
) -> Optional[UUID]: ...
|
||||
116
django-stubs-generated/db/models/fields/files.pyi
Normal file
116
django-stubs-generated/db/models/fields/files.pyi
Normal file
@@ -0,0 +1,116 @@
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.core.checks.messages import Error
|
||||
from django.core.files.base import File
|
||||
from django.core.files.images import ImageFile
|
||||
from django.core.files.storage import FileSystemStorage, Storage
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.fields import Field
|
||||
from django.forms.fields import FileField, ImageField
|
||||
|
||||
|
||||
class FieldFile(File):
|
||||
instance: django.db.models.base.Model = ...
|
||||
field: django.db.models.fields.files.FileField = ...
|
||||
storage: django.core.files.storage.FileSystemStorage = ...
|
||||
def __init__(
|
||||
self, instance: Model, field: FileField, name: Optional[str]
|
||||
) -> None: ...
|
||||
def __eq__(self, other: Any) -> bool: ...
|
||||
def __hash__(self): ...
|
||||
file: Any = ...
|
||||
@property
|
||||
def path(self) -> str: ...
|
||||
@property
|
||||
def url(self) -> str: ...
|
||||
@property
|
||||
def size(self) -> int: ...
|
||||
def open(self, mode: str = ...) -> FieldFile: ...
|
||||
name: Optional[str] = ...
|
||||
def save(self, name: str, content: File, save: bool = ...) -> None: ...
|
||||
def delete(self, save: bool = ...) -> None: ...
|
||||
@property
|
||||
def closed(self) -> bool: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
class FileDescriptor:
|
||||
field: django.db.models.fields.files.FileField = ...
|
||||
def __init__(self, field: FileField) -> None: ...
|
||||
def __get__(
|
||||
self, instance: Optional[Model], cls: Type[Model] = ...
|
||||
) -> Union[FieldFile, FileDescriptor]: ...
|
||||
def __set__(
|
||||
self, instance: Model, value: Optional[Union[File, str]]
|
||||
) -> None: ...
|
||||
|
||||
class FileField(Field):
|
||||
attr_class: Any = ...
|
||||
descriptor_class: Any = ...
|
||||
description: Any = ...
|
||||
storage: Any = ...
|
||||
upload_to: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: Optional[str] = ...,
|
||||
name: None = ...,
|
||||
upload_to: Union[Callable, str] = ...,
|
||||
storage: Optional[Storage] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def check(self, **kwargs: Any) -> List[Error]: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[Optional[str], str, List[Any], Dict[str, Union[bool, str]]]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def get_prep_value(self, value: Union[FieldFile, str]) -> str: ...
|
||||
def pre_save(self, model_instance: Model, add: bool) -> FieldFile: ...
|
||||
def contribute_to_class(
|
||||
self, cls: Type[Model], name: str, **kwargs: Any
|
||||
) -> None: ...
|
||||
def generate_filename(
|
||||
self, instance: Optional[Model], filename: str
|
||||
) -> str: ...
|
||||
def save_form_data(
|
||||
self, instance: Model, data: Optional[Union[bool, File, str]]
|
||||
) -> None: ...
|
||||
def formfield(self, **kwargs: Any) -> FileField: ...
|
||||
|
||||
class ImageFileDescriptor(FileDescriptor):
|
||||
field: django.db.models.fields.files.ImageField
|
||||
def __set__(self, instance: Model, value: Optional[str]) -> None: ...
|
||||
|
||||
class ImageFieldFile(ImageFile, FieldFile):
|
||||
field: django.db.models.fields.files.ImageField
|
||||
instance: django.db.models.base.Model
|
||||
name: Optional[str]
|
||||
storage: django.core.files.storage.DefaultStorage
|
||||
def delete(self, save: bool = ...) -> None: ...
|
||||
|
||||
class ImageField(FileField):
|
||||
attr_class: Any = ...
|
||||
descriptor_class: Any = ...
|
||||
description: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: None = ...,
|
||||
name: None = ...,
|
||||
width_field: Optional[str] = ...,
|
||||
height_field: Optional[str] = ...,
|
||||
**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 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: ...
|
||||
16
django-stubs-generated/db/models/fields/mixins.pyi
Normal file
16
django-stubs-generated/db/models/fields/mixins.pyi
Normal file
@@ -0,0 +1,16 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.db.models.base import Model
|
||||
|
||||
NOT_PROVIDED: Any
|
||||
|
||||
class FieldCacheMixin:
|
||||
def get_cache_name(self) -> None: ...
|
||||
def get_cached_value(
|
||||
self, instance: Model, default: Any = ...
|
||||
) -> Optional[Model]: ...
|
||||
def is_cached(self, instance: Model) -> bool: ...
|
||||
def set_cached_value(
|
||||
self, instance: Model, value: Optional[Model]
|
||||
) -> None: ...
|
||||
def delete_cached_value(self, instance: Model) -> None: ...
|
||||
7
django-stubs-generated/db/models/fields/proxy.pyi
Normal file
7
django-stubs-generated/db/models/fields/proxy.pyi
Normal file
@@ -0,0 +1,7 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.db.models import fields
|
||||
|
||||
|
||||
class OrderWrt(fields.IntegerField):
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
325
django-stubs-generated/db/models/fields/related.pyi
Normal file
325
django-stubs-generated/db/models/fields/related.pyi
Normal file
@@ -0,0 +1,325 @@
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
from uuid import UUID
|
||||
|
||||
from django.core.checks.messages import Error, Warning
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
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_lookups import RelatedIsNull
|
||||
from django.db.models.fields.reverse_related import (ForeignObjectRel,
|
||||
ManyToManyRel,
|
||||
ManyToOneRel, OneToOneRel)
|
||||
from django.db.models.lookups import FieldGetDbPrepValueMixin
|
||||
from django.db.models.query import QuerySet
|
||||
from django.db.models.query_utils import PathInfo, Q
|
||||
from django.db.models.sql.where import WhereNode
|
||||
from django.forms.fields import Field
|
||||
from django.forms.models import ModelChoiceField, ModelMultipleChoiceField
|
||||
|
||||
from . import Field
|
||||
from .mixins import FieldCacheMixin
|
||||
from .related_descriptors import (ForwardManyToOneDescriptor as ForwardManyToOneDescriptor,
|
||||
ForwardOneToOneDescriptor as ForwardOneToOneDescriptor,
|
||||
ManyToManyDescriptor as ManyToManyDescriptor,
|
||||
ReverseManyToOneDescriptor as ReverseManyToOneDescriptor,
|
||||
ReverseOneToOneDescriptor as ReverseOneToOneDescriptor)
|
||||
from .related_lookups import (RelatedExact, RelatedGreaterThan,
|
||||
RelatedGreaterThanOrEqual, RelatedIn,
|
||||
RelatedIsNull, RelatedLessThan,
|
||||
RelatedLessThanOrEqual)
|
||||
from .reverse_related import (ForeignObjectRel, ManyToManyRel, ManyToOneRel,
|
||||
OneToOneRel)
|
||||
|
||||
RECURSIVE_RELATIONSHIP_CONSTANT: str
|
||||
|
||||
def resolve_relation(
|
||||
scope_model: Type[Model], relation: Union[Type[Model], str]
|
||||
) -> Union[Type[Model], str]: ...
|
||||
def lazy_related_operation(
|
||||
function: Callable, model: Type[Model], *related_models: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
|
||||
class RelatedField(FieldCacheMixin, Field):
|
||||
one_to_many: bool = ...
|
||||
one_to_one: bool = ...
|
||||
many_to_many: bool = ...
|
||||
many_to_one: bool = ...
|
||||
def related_model(self) -> Union[Type[Model], str]: ...
|
||||
def check(self, **kwargs: Any) -> List[Error]: ...
|
||||
def db_type(self, connection: DatabaseWrapper) -> None: ...
|
||||
opts: Any = ...
|
||||
def contribute_to_class(
|
||||
self,
|
||||
cls: Type[Model],
|
||||
name: str,
|
||||
private_only: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[Optional[str], str, List[Any], Dict[str, str]]: ...
|
||||
def get_forward_related_filter(
|
||||
self, obj: Model
|
||||
) -> Dict[str, Union[int, UUID]]: ...
|
||||
def get_reverse_related_filter(self, obj: Model) -> Q: ...
|
||||
@property
|
||||
def swappable_setting(self) -> Optional[str]: ...
|
||||
name: Any = ...
|
||||
verbose_name: Any = ...
|
||||
def set_attributes_from_rel(self) -> None: ...
|
||||
def do_related_class(
|
||||
self, other: Type[Model], cls: Type[Model]
|
||||
) -> None: ...
|
||||
def get_limit_choices_to(self) -> Dict[str, int]: ...
|
||||
def formfield(self, **kwargs: Any) -> Field: ...
|
||||
def related_query_name(self) -> str: ...
|
||||
@property
|
||||
def target_field(self) -> Field: ...
|
||||
def get_cache_name(self) -> str: ...
|
||||
|
||||
class ForeignObject(RelatedField):
|
||||
many_to_many: bool = ...
|
||||
many_to_one: bool = ...
|
||||
one_to_many: bool = ...
|
||||
one_to_one: bool = ...
|
||||
requires_unique_target: bool = ...
|
||||
related_accessor_class: Any = ...
|
||||
forward_related_accessor_class: Any = ...
|
||||
rel_class: Any = ...
|
||||
from_fields: Any = ...
|
||||
to_fields: Any = ...
|
||||
swappable: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
to: Union[Type[Model], str],
|
||||
on_delete: Callable,
|
||||
from_fields: Union[List[str], Tuple[str, str]],
|
||||
to_fields: Union[List[None], List[str], Tuple[str, str]],
|
||||
rel: Optional[ForeignObjectRel] = ...,
|
||||
related_name: None = ...,
|
||||
related_query_name: None = ...,
|
||||
limit_choices_to: None = ...,
|
||||
parent_link: bool = ...,
|
||||
swappable: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[
|
||||
Optional[str],
|
||||
str,
|
||||
List[Any],
|
||||
Dict[str, Any],
|
||||
]: ...
|
||||
def resolve_related_fields(self) -> List[Tuple[Field, Field]]: ...
|
||||
@property
|
||||
def related_fields(self) -> List[Tuple[Field, Field]]: ...
|
||||
@property
|
||||
def reverse_related_fields(self) -> List[Tuple[Field, Field]]: ...
|
||||
@property
|
||||
def local_related_fields(self) -> Tuple[Field]: ...
|
||||
@property
|
||||
def foreign_related_fields(self) -> Tuple[Field]: ...
|
||||
def get_local_related_value(
|
||||
self, instance: Model
|
||||
) -> Tuple[Optional[int]]: ...
|
||||
def get_foreign_related_value(
|
||||
self, instance: Model
|
||||
) -> Tuple[Optional[int]]: ...
|
||||
@staticmethod
|
||||
def get_instance_value_for_fields(
|
||||
instance: Model, fields: Tuple[Field]
|
||||
) -> Tuple[Optional[int]]: ...
|
||||
def get_attname_column(self) -> Tuple[str, None]: ...
|
||||
def get_joining_columns(
|
||||
self, reverse_join: bool = ...
|
||||
) -> Tuple[Tuple[str, str]]: ...
|
||||
def get_reverse_joining_columns(self) -> Tuple: ...
|
||||
def get_extra_descriptor_filter(
|
||||
self, instance: Model
|
||||
) -> Dict[Any, Any]: ...
|
||||
def get_extra_restriction(
|
||||
self, where_class: Type[WhereNode], alias: str, related_alias: str
|
||||
) -> None: ...
|
||||
def get_path_info(
|
||||
self, filtered_relation: None = ...
|
||||
) -> List[PathInfo]: ...
|
||||
def get_reverse_path_info(self, filtered_relation: Optional[Any] = ...): ...
|
||||
@classmethod
|
||||
def get_lookups(
|
||||
cls
|
||||
) -> Dict[str, Type[Union[RelatedIsNull, FieldGetDbPrepValueMixin]]]: ...
|
||||
def contribute_to_class(
|
||||
self,
|
||||
cls: Type[Model],
|
||||
name: str,
|
||||
private_only: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def contribute_to_related_class(
|
||||
self, cls: Type[Model], related: ForeignObjectRel
|
||||
) -> None: ...
|
||||
|
||||
class ForeignKey(ForeignObject):
|
||||
many_to_many: bool = ...
|
||||
many_to_one: bool = ...
|
||||
one_to_many: bool = ...
|
||||
one_to_one: bool = ...
|
||||
rel_class: Any = ...
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
db_constraint: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
to: Union[Type[Model], str],
|
||||
on_delete: Callable,
|
||||
related_name: Optional[str] = ...,
|
||||
related_query_name: None = ...,
|
||||
limit_choices_to: Optional[
|
||||
Union[Callable, Dict[str, Union[int, str]]]
|
||||
] = ...,
|
||||
parent_link: bool = ...,
|
||||
to_field: Optional[str] = ...,
|
||||
db_constraint: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def check(self, **kwargs: Any) -> List[Warning]: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[
|
||||
Optional[str],
|
||||
str,
|
||||
List[Any],
|
||||
Dict[str, Union[Callable, Dict[str, Union[int, str]], str]],
|
||||
]: ...
|
||||
def to_python(self, value: Union[int, str]) -> int: ...
|
||||
@property
|
||||
def target_field(self) -> Field: ...
|
||||
def get_reverse_path_info(
|
||||
self, filtered_relation: None = ...
|
||||
) -> List[PathInfo]: ...
|
||||
def validate(
|
||||
self, value: Union[int, str], model_instance: Model
|
||||
) -> None: ...
|
||||
def get_attname(self) -> str: ...
|
||||
def get_attname_column(self) -> Tuple[str, str]: ...
|
||||
def get_default(self) -> Optional[int]: ...
|
||||
def get_db_prep_save(
|
||||
self,
|
||||
value: Optional[Union[int, str, UUID]],
|
||||
connection: DatabaseWrapper,
|
||||
) -> Optional[Union[int, str]]: ...
|
||||
def get_db_prep_value(
|
||||
self,
|
||||
value: Union[int, str, UUID],
|
||||
connection: DatabaseWrapper,
|
||||
prepared: bool = ...,
|
||||
) -> Union[int, str]: ...
|
||||
def contribute_to_related_class(
|
||||
self, cls: Type[Model], related: ManyToOneRel
|
||||
) -> None: ...
|
||||
def formfield(
|
||||
self, *, using: Optional[Any] = ..., **kwargs: Any
|
||||
) -> ModelChoiceField: ...
|
||||
def db_check(self, connection: DatabaseWrapper) -> List[Any]: ...
|
||||
def db_type(self, connection: DatabaseWrapper) -> str: ...
|
||||
def db_parameters(
|
||||
self, connection: DatabaseWrapper
|
||||
) -> Dict[str, Union[List[Any], str]]: ...
|
||||
def convert_empty_strings(
|
||||
self, value: Any, expression: Any, connection: Any
|
||||
): ...
|
||||
def get_db_converters(self, connection: DatabaseWrapper) -> List[Any]: ...
|
||||
def get_col(
|
||||
self,
|
||||
alias: str,
|
||||
output_field: Optional[Union[Field, OneToOneRel]] = ...,
|
||||
) -> Col: ...
|
||||
|
||||
class OneToOneField(ForeignKey):
|
||||
many_to_many: bool = ...
|
||||
many_to_one: bool = ...
|
||||
one_to_many: bool = ...
|
||||
one_to_one: bool = ...
|
||||
related_accessor_class: Any = ...
|
||||
forward_related_accessor_class: Any = ...
|
||||
rel_class: Any = ...
|
||||
description: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
to: Union[Type[Model], str],
|
||||
on_delete: Callable,
|
||||
to_field: Optional[str] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[
|
||||
Optional[str], str, List[Any], Dict[str, Union[Callable, bool, str]]
|
||||
]: ...
|
||||
def formfield(self, **kwargs: Any) -> None: ...
|
||||
def save_form_data(
|
||||
self, instance: Model, data: Optional[Model]
|
||||
) -> None: ...
|
||||
|
||||
def create_many_to_many_intermediary_model(field: Any, klass: Any): ...
|
||||
|
||||
class ManyToManyField(RelatedField):
|
||||
many_to_many: bool = ...
|
||||
many_to_one: bool = ...
|
||||
one_to_many: bool = ...
|
||||
one_to_one: bool = ...
|
||||
rel_class: Any = ...
|
||||
description: Any = ...
|
||||
has_null_arg: Any = ...
|
||||
db_table: Any = ...
|
||||
swappable: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
to: Union[Type[Model], str],
|
||||
related_name: Optional[str] = ...,
|
||||
related_query_name: Optional[str] = ...,
|
||||
limit_choices_to: Optional[Callable] = ...,
|
||||
symmetrical: Optional[bool] = ...,
|
||||
through: Optional[str] = ...,
|
||||
through_fields: Optional[Tuple[str, str]] = ...,
|
||||
db_constraint: bool = ...,
|
||||
db_table: None = ...,
|
||||
swappable: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[Optional[str], str, List[Any], Dict[str, str]]: ...
|
||||
def get_path_info(
|
||||
self, filtered_relation: None = ...
|
||||
) -> List[PathInfo]: ...
|
||||
def get_reverse_path_info(
|
||||
self, filtered_relation: None = ...
|
||||
) -> List[PathInfo]: ...
|
||||
m2m_db_table: Any = ...
|
||||
def contribute_to_class(
|
||||
self, cls: Type[Model], name: str, **kwargs: Any
|
||||
) -> None: ...
|
||||
m2m_column_name: Any = ...
|
||||
m2m_reverse_name: Any = ...
|
||||
m2m_field_name: Any = ...
|
||||
m2m_reverse_field_name: Any = ...
|
||||
m2m_target_field_name: Any = ...
|
||||
m2m_reverse_target_field_name: Any = ...
|
||||
def contribute_to_related_class(
|
||||
self, cls: Type[Model], related: ManyToManyRel
|
||||
) -> None: ...
|
||||
def set_attributes_from_rel(self) -> None: ...
|
||||
def value_from_object(self, obj: Model) -> List[Model]: ...
|
||||
def save_form_data(self, instance: Model, data: QuerySet) -> None: ...
|
||||
def formfield(
|
||||
self, *, using: Optional[Any] = ..., **kwargs: Any
|
||||
) -> ModelMultipleChoiceField: ...
|
||||
def db_check(self, connection: Any): ...
|
||||
def db_type(self, connection: Any): ...
|
||||
def db_parameters(self, connection: DatabaseWrapper) -> Dict[str, None]: ...
|
||||
110
django-stubs-generated/db/models/fields/related_descriptors.pyi
Normal file
110
django-stubs-generated/db/models/fields/related_descriptors.pyi
Normal file
@@ -0,0 +1,110 @@
|
||||
from typing import Any, Callable, List, Optional, Tuple, Type, Union, Generic, TypeVar
|
||||
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.expressions import F
|
||||
from django.db.models.fields.mixins import FieldCacheMixin
|
||||
from django.db.models.fields.related import ForeignObject, RelatedField, OneToOneField
|
||||
from django.db.models.fields.reverse_related import ManyToManyRel, OneToOneRel
|
||||
from django.db.models.query import QuerySet
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
|
||||
class ForwardManyToOneDescriptor:
|
||||
RelatedObjectDoesNotExist: Type[ObjectDoesNotExist]
|
||||
field: ForeignObject = ...
|
||||
|
||||
def __init__(self, field_with_rel: ForeignObject) -> None: ...
|
||||
|
||||
def is_cached(self, instance: Model) -> bool: ...
|
||||
|
||||
def get_queryset(self, **hints: Any) -> QuerySet: ...
|
||||
|
||||
def get_prefetch_queryset(
|
||||
self, instances: List[Model], queryset: Optional[QuerySet] = ...
|
||||
) -> Tuple[QuerySet, Callable, Callable, bool, str, bool]: ...
|
||||
|
||||
def get_object(self, instance: Model) -> Model: ...
|
||||
|
||||
def __get__(
|
||||
self, instance: Optional[Model], cls: Type[Model] = ...
|
||||
) -> Optional[Union[Model, ForwardManyToOneDescriptor]]: ...
|
||||
|
||||
def __set__(
|
||||
self, instance: Model, value: Optional[Union[Model, F]]
|
||||
) -> None: ...
|
||||
|
||||
def __reduce__(self) -> Tuple[Callable, Tuple[Type[Model], str]]: ...
|
||||
|
||||
|
||||
class ForwardOneToOneDescriptor(ForwardManyToOneDescriptor):
|
||||
RelatedObjectDoesNotExist: Type[ObjectDoesNotExist]
|
||||
field: OneToOneField
|
||||
|
||||
def get_object(self, instance: Model) -> Model: ...
|
||||
|
||||
def __set__(self, instance: Model, value: Optional[Model]) -> None: ...
|
||||
|
||||
|
||||
class ReverseOneToOneDescriptor:
|
||||
RelatedObjectDoesNotExist: Type[ObjectDoesNotExist]
|
||||
related: OneToOneRel = ...
|
||||
|
||||
def __init__(self, related: OneToOneRel) -> None: ...
|
||||
|
||||
def is_cached(self, instance: Model) -> bool: ...
|
||||
|
||||
def get_queryset(self, **hints: Any) -> QuerySet: ...
|
||||
|
||||
def get_prefetch_queryset(
|
||||
self, instances: List[Model], queryset: Optional[QuerySet] = ...
|
||||
) -> Tuple[QuerySet, Callable, Callable, bool, str, bool]: ...
|
||||
|
||||
def __get__(
|
||||
self, instance: Optional[Model], cls: Type[Model] = ...
|
||||
) -> Union[Model, ReverseOneToOneDescriptor]: ...
|
||||
|
||||
def __set__(self, instance: Model, value: Optional[Model]) -> None: ...
|
||||
|
||||
def __reduce__(self) -> Tuple[Callable, Tuple[Type[Model], str]]: ...
|
||||
|
||||
|
||||
class ReverseManyToOneDescriptor:
|
||||
rel: FieldCacheMixin = ...
|
||||
field: FieldCacheMixin = ...
|
||||
|
||||
def __init__(self, rel: FieldCacheMixin) -> None: ...
|
||||
|
||||
def related_manager_cls(self): ...
|
||||
|
||||
def __get__(
|
||||
self, instance: Optional[Model], cls: Type[Model] = ...
|
||||
) -> ReverseManyToOneDescriptor: ...
|
||||
|
||||
def __set__(self, instance: Model, value: List[Model]) -> Any: ...
|
||||
|
||||
|
||||
def create_reverse_many_to_one_manager(superclass: Any, rel: Any): ...
|
||||
|
||||
|
||||
class ManyToManyDescriptor(ReverseManyToOneDescriptor):
|
||||
field: RelatedField
|
||||
rel: ManyToManyRel
|
||||
reverse: bool = ...
|
||||
|
||||
def __init__(self, rel: ManyToManyRel, reverse: bool = ...) -> None: ...
|
||||
|
||||
@property
|
||||
def through(self) -> Type[Model]: ...
|
||||
|
||||
def related_manager_cls(self): ...
|
||||
|
||||
|
||||
class _ForwardManyToManyManager(Generic[_T]):
|
||||
def all(self) -> QuerySet: ...
|
||||
|
||||
|
||||
def create_forward_many_to_many_manager(
|
||||
superclass: Any, rel: Any, reverse: Any
|
||||
) -> _ForwardManyToManyManager: ...
|
||||
74
django-stubs-generated/db/models/fields/related_lookups.pyi
Normal file
74
django-stubs-generated/db/models/fields/related_lookups.pyi
Normal file
@@ -0,0 +1,74 @@
|
||||
from collections import OrderedDict
|
||||
from typing import Any, List, Optional, Tuple, Type, Union
|
||||
from uuid import UUID
|
||||
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
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.sql.compiler import SQLCompiler
|
||||
from django.db.models.sql.query import Query
|
||||
|
||||
|
||||
class MultiColSource:
|
||||
alias: str
|
||||
field: django.db.models.fields.related.ForeignObject
|
||||
sources: Tuple[django.db.models.fields.Field, django.db.models.fields.Field]
|
||||
targets: Tuple[django.db.models.fields.Field, django.db.models.fields.Field]
|
||||
contains_aggregate: bool = ...
|
||||
output_field: django.db.models.fields.related.ForeignObject = ...
|
||||
def __init__(
|
||||
self,
|
||||
alias: str,
|
||||
targets: Tuple[Field, Field],
|
||||
sources: Tuple[Field, Field],
|
||||
field: related.ForeignObject,
|
||||
) -> None: ...
|
||||
def relabeled_clone(self, relabels: OrderedDict) -> MultiColSource: ...
|
||||
def get_lookup(self, lookup: str) -> Type[BuiltinLookup]: ...
|
||||
|
||||
def get_normalized_value(
|
||||
value: Any, lhs: Union[Col, MultiColSource]
|
||||
) -> Tuple[None]: ...
|
||||
|
||||
class RelatedIn(In):
|
||||
bilateral_transforms: List[Any]
|
||||
contains_aggregate: bool
|
||||
lhs: Union[
|
||||
django.db.models.expressions.Col,
|
||||
django.db.models.fields.related_lookups.MultiColSource,
|
||||
]
|
||||
rhs: Union[
|
||||
List[django.db.models.base.Model],
|
||||
List[int],
|
||||
List[uuid.UUID],
|
||||
Set[django.contrib.contenttypes.models.ContentType],
|
||||
Set[int],
|
||||
Set[str],
|
||||
Set[uuid.UUID],
|
||||
django.db.models.sql.query.Query,
|
||||
] = ...
|
||||
def get_prep_lookup(
|
||||
self
|
||||
) -> Union[List[Model], List[int], List[str], List[UUID], Query]: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Any]]: ...
|
||||
|
||||
class RelatedLookupMixin:
|
||||
rhs: Any = ...
|
||||
def get_prep_lookup(self) -> Any: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Union[int, str]]]: ...
|
||||
|
||||
class RelatedExact(RelatedLookupMixin, Exact): ...
|
||||
class RelatedLessThan(RelatedLookupMixin, LessThan): ...
|
||||
class RelatedGreaterThan(RelatedLookupMixin, GreaterThan): ...
|
||||
class RelatedGreaterThanOrEqual(RelatedLookupMixin, GreaterThanOrEqual): ...
|
||||
class RelatedLessThanOrEqual(RelatedLookupMixin, LessThanOrEqual): ...
|
||||
class RelatedIsNull(RelatedLookupMixin, IsNull): ...
|
||||
180
django-stubs-generated/db/models/fields/reverse_related.pyi
Normal file
180
django-stubs-generated/db/models/fields/reverse_related.pyi
Normal file
@@ -0,0 +1,180 @@
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.fields import AutoField, Field
|
||||
from django.db.models.fields.related import (ForeignKey, OneToOneField,
|
||||
RelatedField)
|
||||
from django.db.models.lookups import BuiltinLookup, StartsWith
|
||||
from django.db.models.query_utils import FilteredRelation, PathInfo, Q
|
||||
from django.db.models.sql.where import WhereNode
|
||||
|
||||
from .mixins import FieldCacheMixin
|
||||
|
||||
|
||||
class ForeignObjectRel(FieldCacheMixin):
|
||||
hidden: bool
|
||||
many_to_many: bool
|
||||
many_to_one: bool
|
||||
name: str
|
||||
one_to_many: bool
|
||||
one_to_one: bool
|
||||
related_model: Type[django.db.models.base.Model]
|
||||
auto_created: bool = ...
|
||||
concrete: bool = ...
|
||||
editable: bool = ...
|
||||
is_relation: bool = ...
|
||||
null: bool = ...
|
||||
field: django.db.models.fields.related.ForeignObject = ...
|
||||
model: Union[Type[django.db.models.base.Model], str] = ...
|
||||
related_name: Optional[str] = ...
|
||||
related_query_name: None = ...
|
||||
limit_choices_to: Dict[Any, Any] = ...
|
||||
parent_link: bool = ...
|
||||
on_delete: Callable = ...
|
||||
symmetrical: bool = ...
|
||||
multiple: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
field: RelatedField,
|
||||
to: Union[Type[Model], str],
|
||||
related_name: Optional[str] = ...,
|
||||
related_query_name: Optional[str] = ...,
|
||||
limit_choices_to: Optional[
|
||||
Union[Callable, Dict[str, Union[int, str]], Q]
|
||||
] = ...,
|
||||
parent_link: bool = ...,
|
||||
on_delete: Optional[Callable] = ...,
|
||||
) -> None: ...
|
||||
def hidden(self) -> bool: ...
|
||||
def name(self) -> str: ...
|
||||
@property
|
||||
def remote_field(self) -> RelatedField: ...
|
||||
@property
|
||||
def target_field(self) -> AutoField: ...
|
||||
def related_model(self) -> Type[Model]: ...
|
||||
def many_to_many(self) -> bool: ...
|
||||
def many_to_one(self) -> bool: ...
|
||||
def one_to_many(self) -> bool: ...
|
||||
def one_to_one(self) -> bool: ...
|
||||
def get_lookup(self, lookup_name: str) -> Type[BuiltinLookup]: ...
|
||||
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 is_hidden(self) -> bool: ...
|
||||
def get_joining_columns(self) -> Tuple: ...
|
||||
def get_extra_restriction(
|
||||
self, where_class: Type[WhereNode], alias: str, related_alias: str
|
||||
) -> Optional[Union[StartsWith, WhereNode]]: ...
|
||||
field_name: None = ...
|
||||
def set_field_name(self) -> None: ...
|
||||
def get_accessor_name(
|
||||
self, model: Optional[Type[Model]] = ...
|
||||
) -> Optional[str]: ...
|
||||
def get_path_info(
|
||||
self, filtered_relation: Optional[FilteredRelation] = ...
|
||||
) -> List[PathInfo]: ...
|
||||
def get_cache_name(self) -> str: ...
|
||||
|
||||
class ManyToOneRel(ForeignObjectRel):
|
||||
field: django.db.models.fields.related.ForeignKey
|
||||
hidden: bool
|
||||
limit_choices_to: Union[
|
||||
Callable, Dict[str, Union[int, str]], django.db.models.query_utils.Q
|
||||
]
|
||||
many_to_many: bool
|
||||
many_to_one: bool
|
||||
model: Union[Type[django.db.models.base.Model], str]
|
||||
multiple: bool
|
||||
name: str
|
||||
on_delete: Callable
|
||||
one_to_many: bool
|
||||
one_to_one: bool
|
||||
parent_link: bool
|
||||
related_model: Type[django.db.models.base.Model]
|
||||
related_name: Optional[str]
|
||||
related_query_name: Optional[str]
|
||||
symmetrical: bool
|
||||
field_name: Optional[str] = ...
|
||||
def __init__(
|
||||
self,
|
||||
field: ForeignKey,
|
||||
to: Union[Type[Model], str],
|
||||
field_name: Optional[str],
|
||||
related_name: Optional[str] = ...,
|
||||
related_query_name: Optional[str] = ...,
|
||||
limit_choices_to: Optional[
|
||||
Union[Callable, Dict[str, Union[int, str]], Q]
|
||||
] = ...,
|
||||
parent_link: bool = ...,
|
||||
on_delete: Callable = ...,
|
||||
) -> None: ...
|
||||
def get_related_field(self) -> Field: ...
|
||||
def set_field_name(self) -> None: ...
|
||||
|
||||
class OneToOneRel(ManyToOneRel):
|
||||
field: django.db.models.fields.related.OneToOneField
|
||||
field_name: Optional[str]
|
||||
hidden: bool
|
||||
limit_choices_to: Dict[str, str]
|
||||
many_to_many: bool
|
||||
many_to_one: bool
|
||||
model: Union[Type[django.db.models.base.Model], str]
|
||||
name: str
|
||||
on_delete: Callable
|
||||
one_to_many: bool
|
||||
one_to_one: bool
|
||||
parent_link: bool
|
||||
related_model: Type[django.db.models.base.Model]
|
||||
related_name: Optional[str]
|
||||
related_query_name: Optional[str]
|
||||
symmetrical: bool
|
||||
multiple: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
field: OneToOneField,
|
||||
to: Union[Type[Model], str],
|
||||
field_name: Optional[str],
|
||||
related_name: Optional[str] = ...,
|
||||
related_query_name: Optional[str] = ...,
|
||||
limit_choices_to: Optional[Dict[str, str]] = ...,
|
||||
parent_link: bool = ...,
|
||||
on_delete: Callable = ...,
|
||||
) -> None: ...
|
||||
|
||||
class ManyToManyRel(ForeignObjectRel):
|
||||
field: django.db.models.fields.related.RelatedField
|
||||
field_name: None
|
||||
hidden: bool
|
||||
limit_choices_to: Union[Callable, Dict[str, str]]
|
||||
model: Union[Type[django.db.models.base.Model], str]
|
||||
multiple: bool
|
||||
name: str
|
||||
on_delete: None
|
||||
one_to_many: bool
|
||||
one_to_one: bool
|
||||
parent_link: bool
|
||||
related_model: Type[django.db.models.base.Model]
|
||||
related_name: Optional[str]
|
||||
related_query_name: Optional[str]
|
||||
through: Optional[Union[Type[django.db.models.base.Model], str]] = ...
|
||||
through_fields: Optional[Tuple[str, str]] = ...
|
||||
symmetrical: bool = ...
|
||||
db_constraint: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
field: RelatedField,
|
||||
to: Union[Type[Model], str],
|
||||
related_name: Optional[str] = ...,
|
||||
related_query_name: Optional[str] = ...,
|
||||
limit_choices_to: Optional[Union[Callable, Dict[str, str]]] = ...,
|
||||
symmetrical: bool = ...,
|
||||
through: Optional[Union[Type[Model], str]] = ...,
|
||||
through_fields: Optional[Tuple[str, str]] = ...,
|
||||
db_constraint: bool = ...,
|
||||
) -> None: ...
|
||||
def get_related_field(self) -> Field: ...
|
||||
70
django-stubs-generated/db/models/functions/comparison.pyi
Normal file
70
django-stubs-generated/db/models/functions/comparison.pyi
Normal file
@@ -0,0 +1,70 @@
|
||||
from datetime import date, datetime
|
||||
from decimal import Decimal
|
||||
from typing import Any, List, Optional, Tuple, Union
|
||||
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.models import Func
|
||||
from django.db.models.expressions import Value
|
||||
from django.db.models.fields import Field
|
||||
from django.db.models.sql.compiler import SQLCompiler
|
||||
|
||||
|
||||
class Cast(Func):
|
||||
contains_aggregate: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.Field
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
template: str = ...
|
||||
def __init__(
|
||||
self, expression: Union[date, Decimal, Value, str], output_field: Field
|
||||
) -> None: ...
|
||||
def as_sql(
|
||||
self,
|
||||
compiler: SQLCompiler,
|
||||
connection: DatabaseWrapper,
|
||||
**extra_context: Any
|
||||
) -> Tuple[str, Union[List[date], List[Decimal]]]: ...
|
||||
def as_mysql(self, compiler: Any, connection: Any): ...
|
||||
def as_postgresql(self, compiler: Any, connection: Any): ...
|
||||
|
||||
class Coalesce(Func):
|
||||
contains_aggregate: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.Field
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
def __init__(self, *expressions: Any, **extra: Any) -> None: ...
|
||||
def as_oracle(self, compiler: Any, connection: Any): ...
|
||||
|
||||
class Greatest(Func):
|
||||
contains_aggregate: bool
|
||||
contains_over_clause: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.Field
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
def __init__(self, *expressions: Any, **extra: Any) -> None: ...
|
||||
def as_sqlite(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[datetime]]: ...
|
||||
|
||||
class Least(Func):
|
||||
contains_aggregate: bool
|
||||
contains_over_clause: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.Field
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
def __init__(self, *expressions: Any, **extra: Any) -> None: ...
|
||||
def as_sqlite(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[datetime]]: ...
|
||||
280
django-stubs-generated/db/models/functions/datetime.pyi
Normal file
280
django-stubs-generated/db/models/functions/datetime.pyi
Normal file
@@ -0,0 +1,280 @@
|
||||
from datetime import datetime
|
||||
from typing import Any, List, Optional, Set, Tuple, Union, Callable, Dict
|
||||
|
||||
from django.db import models
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.models import Func, Transform
|
||||
from django.db.models.expressions import Col, Expression, Combinable
|
||||
from django.db.models.fields import Field
|
||||
from django.db.models.sql.compiler import SQLCompiler
|
||||
from django.db.models.sql.query import Query
|
||||
|
||||
|
||||
class TimezoneMixin:
|
||||
tzinfo: Any = ...
|
||||
def get_tzname(self) -> Optional[str]: ...
|
||||
|
||||
class Extract(TimezoneMixin, Transform):
|
||||
contains_aggregate: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
source_expressions: List[Combinable]
|
||||
lookup_name: Optional[str] = ...
|
||||
output_field: Any = ...
|
||||
tzinfo: None = ...
|
||||
def __init__(
|
||||
self,
|
||||
expression: Union[Expression, str],
|
||||
lookup_name: Optional[str] = ...,
|
||||
tzinfo: None = ...,
|
||||
**extra: Any
|
||||
) -> None: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Any]]: ...
|
||||
def resolve_expression(
|
||||
self,
|
||||
query: Query = ...,
|
||||
allow_joins: bool = ...,
|
||||
reuse: Optional[Set[Any]] = ...,
|
||||
summarize: bool = ...,
|
||||
for_save: bool = ...,
|
||||
) -> Extract: ...
|
||||
|
||||
class ExtractYear(Extract):
|
||||
contains_aggregate: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
source_expressions: List[Combinable]
|
||||
tzinfo: None
|
||||
lookup_name: str = ...
|
||||
|
||||
class ExtractMonth(Extract):
|
||||
contains_aggregate: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
source_expressions: List[Combinable]
|
||||
tzinfo: None
|
||||
lookup_name: str = ...
|
||||
|
||||
class ExtractDay(Extract):
|
||||
contains_aggregate: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
source_expressions: List[Combinable]
|
||||
tzinfo: None
|
||||
lookup_name: str = ...
|
||||
|
||||
class ExtractWeek(Extract):
|
||||
contains_aggregate: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
source_expressions: List[Combinable]
|
||||
tzinfo: None
|
||||
lookup_name: str = ...
|
||||
|
||||
class ExtractWeekDay(Extract):
|
||||
contains_aggregate: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
source_expressions: List[Combinable]
|
||||
tzinfo: None
|
||||
lookup_name: str = ...
|
||||
|
||||
class ExtractQuarter(Extract):
|
||||
contains_aggregate: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
source_expressions: List[Combinable]
|
||||
tzinfo: None
|
||||
lookup_name: str = ...
|
||||
|
||||
class ExtractHour(Extract):
|
||||
contains_aggregate: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
source_expressions: List[Combinable]
|
||||
tzinfo: None
|
||||
lookup_name: str = ...
|
||||
|
||||
class ExtractMinute(Extract):
|
||||
contains_aggregate: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
source_expressions: List[Combinable]
|
||||
tzinfo: None
|
||||
lookup_name: str = ...
|
||||
|
||||
class ExtractSecond(Extract):
|
||||
contains_aggregate: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
source_expressions: List[Combinable]
|
||||
tzinfo: None
|
||||
lookup_name: str = ...
|
||||
|
||||
class Now(Func):
|
||||
contains_aggregate: bool
|
||||
contains_over_clause: bool
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
source_expressions: List[Any]
|
||||
template: str = ...
|
||||
output_field: Any = ...
|
||||
def as_postgresql(self, compiler: Any, connection: Any): ...
|
||||
|
||||
class TruncBase(TimezoneMixin, Transform):
|
||||
kind: Any = ...
|
||||
tzinfo: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
expression: Union[Col, str],
|
||||
output_field: Optional[Field] = ...,
|
||||
tzinfo: None = ...,
|
||||
**extra: Any
|
||||
) -> None: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Any]]: ...
|
||||
def resolve_expression(
|
||||
self,
|
||||
query: Query = ...,
|
||||
allow_joins: bool = ...,
|
||||
reuse: Optional[Set[Any]] = ...,
|
||||
summarize: bool = ...,
|
||||
for_save: bool = ...,
|
||||
) -> TruncBase: ...
|
||||
def convert_value(
|
||||
self,
|
||||
value: datetime,
|
||||
expression: models.functions.TruncBase,
|
||||
connection: DatabaseWrapper,
|
||||
) -> datetime: ...
|
||||
|
||||
class Trunc(TruncBase):
|
||||
contains_aggregate: bool
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: Union[
|
||||
models.fields.DateTimeCheckMixin,
|
||||
models.fields.IntegerField,
|
||||
]
|
||||
source_expressions: List[Combinable]
|
||||
tzinfo: None
|
||||
kind: str = ...
|
||||
def __init__(
|
||||
self,
|
||||
expression: str,
|
||||
kind: str,
|
||||
output_field: Optional[Field] = ...,
|
||||
tzinfo: None = ...,
|
||||
**extra: Any
|
||||
) -> None: ...
|
||||
|
||||
class TruncYear(TruncBase):
|
||||
contains_aggregate: bool
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: models.fields.DateTimeCheckMixin
|
||||
source_expressions: List[Combinable]
|
||||
tzinfo: None
|
||||
kind: str = ...
|
||||
|
||||
class TruncQuarter(TruncBase):
|
||||
contains_aggregate: bool
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: models.fields.DateTimeCheckMixin
|
||||
source_expressions: List[Combinable]
|
||||
tzinfo: None
|
||||
kind: str = ...
|
||||
|
||||
class TruncMonth(TruncBase):
|
||||
contains_aggregate: bool
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: models.fields.DateTimeCheckMixin
|
||||
source_expressions: List[Combinable]
|
||||
tzinfo: None
|
||||
kind: str = ...
|
||||
|
||||
class TruncWeek(TruncBase):
|
||||
contains_aggregate: bool
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: models.fields.DateTimeCheckMixin
|
||||
source_expressions: List[Combinable]
|
||||
tzinfo: None
|
||||
kind: str = ...
|
||||
|
||||
class TruncDay(TruncBase):
|
||||
contains_aggregate: bool
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: models.fields.DateTimeCheckMixin
|
||||
source_expressions: List[Combinable]
|
||||
tzinfo: None
|
||||
kind: str = ...
|
||||
|
||||
class TruncDate(TruncBase):
|
||||
contains_aggregate: bool
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
source_expressions: List[Combinable]
|
||||
tzinfo: None
|
||||
kind: str = ...
|
||||
lookup_name: str = ...
|
||||
output_field: models.fields.TimeField = ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Any]]: ...
|
||||
|
||||
class TruncTime(TruncBase):
|
||||
contains_aggregate: bool
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
source_expressions: List[Combinable]
|
||||
tzinfo: None
|
||||
kind: str = ...
|
||||
lookup_name: str = ...
|
||||
output_field: models.fields.DateField = ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Any]]: ...
|
||||
|
||||
class TruncHour(TruncBase):
|
||||
contains_aggregate: bool
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: models.fields.DateTimeCheckMixin
|
||||
source_expressions: List[Combinable]
|
||||
tzinfo: None
|
||||
kind: str = ...
|
||||
|
||||
class TruncMinute(TruncBase):
|
||||
contains_aggregate: bool
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: models.fields.DateTimeCheckMixin
|
||||
source_expressions: List[Combinable]
|
||||
tzinfo: None
|
||||
kind: str = ...
|
||||
|
||||
class TruncSecond(TruncBase):
|
||||
contains_aggregate: bool
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: models.fields.DateTimeCheckMixin
|
||||
source_expressions: List[Combinable]
|
||||
tzinfo: None
|
||||
kind: str = ...
|
||||
267
django-stubs-generated/db/models/functions/text.pyi
Normal file
267
django-stubs-generated/db/models/functions/text.pyi
Normal file
@@ -0,0 +1,267 @@
|
||||
from typing import Any, List, Optional, Tuple, Union, Dict, Callable
|
||||
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.models import Func, Transform
|
||||
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: ...
|
||||
|
||||
class Chr(Transform):
|
||||
contains_aggregate: bool
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.IntegerField
|
||||
source_expressions: List[django.db.models.expressions.Expression]
|
||||
function: str = ...
|
||||
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]]: ...
|
||||
|
||||
class ConcatPair(Func):
|
||||
contains_aggregate: bool
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.CharField
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
def as_sqlite(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[str]]: ...
|
||||
def as_mysql(self, compiler: Any, connection: Any): ...
|
||||
def coalesce(self) -> ConcatPair: ...
|
||||
|
||||
class Concat(Func):
|
||||
contains_aggregate: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.Field
|
||||
source_expressions: List[django.db.models.functions.text.ConcatPair]
|
||||
function: Any = ...
|
||||
template: str = ...
|
||||
def __init__(self, *expressions: Any, **extra: Any) -> None: ...
|
||||
|
||||
class Left(Func):
|
||||
contains_aggregate: bool
|
||||
contains_over_clause: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.CharField
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
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]]: ...
|
||||
as_oracle: Any = ...
|
||||
as_sqlite: Any = ...
|
||||
|
||||
class Length(Transform):
|
||||
contains_aggregate: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
lookup_name: str = ...
|
||||
output_field: Any = ...
|
||||
def as_mysql(self, compiler: Any, connection: Any): ...
|
||||
|
||||
class Lower(Transform):
|
||||
contains_aggregate: bool
|
||||
contains_column_references: bool
|
||||
contains_over_clause: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.Field
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
lookup_name: str = ...
|
||||
|
||||
class LPad(BytesToCharFieldConversionMixin, Func):
|
||||
contains_aggregate: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.CharField
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
def __init__(
|
||||
self,
|
||||
expression: str,
|
||||
length: Union[Length, int],
|
||||
fill_text: Value = ...,
|
||||
**extra: Any
|
||||
) -> None: ...
|
||||
|
||||
class LTrim(Transform):
|
||||
contains_aggregate: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.CharField
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
lookup_name: str = ...
|
||||
|
||||
class Ord(Transform):
|
||||
contains_aggregate: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
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]]: ...
|
||||
|
||||
class Repeat(BytesToCharFieldConversionMixin, Func):
|
||||
contains_aggregate: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.CharField
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
def __init__(
|
||||
self,
|
||||
expression: Union[Value, str],
|
||||
number: Union[Length, int],
|
||||
**extra: Any
|
||||
) -> None: ...
|
||||
def as_oracle(
|
||||
self, compiler: Any, connection: Any, **extra_context: Any
|
||||
): ...
|
||||
|
||||
class Replace(Func):
|
||||
contains_aggregate: bool
|
||||
contains_over_clause: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.CharField
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
def __init__(
|
||||
self,
|
||||
expression: Combinable,
|
||||
text: Value,
|
||||
replacement: Value = ...,
|
||||
**extra: Any
|
||||
) -> None: ...
|
||||
|
||||
class Right(Left):
|
||||
contains_aggregate: bool
|
||||
contains_over_clause: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.CharField
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
def get_substr(self) -> Substr: ...
|
||||
|
||||
class RPad(LPad):
|
||||
contains_aggregate: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.CharField
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
|
||||
class RTrim(Transform):
|
||||
contains_aggregate: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.CharField
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
lookup_name: str = ...
|
||||
|
||||
class StrIndex(Func):
|
||||
contains_aggregate: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
arity: int = ...
|
||||
output_field: Any = ...
|
||||
def as_postgresql(self, compiler: Any, connection: Any): ...
|
||||
|
||||
class Substr(Func):
|
||||
contains_aggregate: bool
|
||||
contains_over_clause: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.CharField
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
def __init__(
|
||||
self,
|
||||
expression: Union[Expression, str],
|
||||
pos: Union[Expression, int],
|
||||
length: Optional[Union[Value, int]] = ...,
|
||||
**extra: Any
|
||||
) -> None: ...
|
||||
def as_sqlite(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Union[int, str]]]: ...
|
||||
def as_oracle(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[int]]: ...
|
||||
|
||||
class Trim(Transform):
|
||||
contains_aggregate: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.CharField
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
lookup_name: str = ...
|
||||
|
||||
class Upper(Transform):
|
||||
contains_aggregate: bool
|
||||
contains_over_clause: bool
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.Field
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
lookup_name: str = ...
|
||||
81
django-stubs-generated/db/models/functions/window.pyi
Normal file
81
django-stubs-generated/db/models/functions/window.pyi
Normal file
@@ -0,0 +1,81 @@
|
||||
from typing import Any, Optional, Dict, List
|
||||
|
||||
from django.db.models import Func
|
||||
|
||||
|
||||
class CumeDist(Func):
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
output_field: Any = ...
|
||||
window_compatible: bool = ...
|
||||
|
||||
class DenseRank(Func):
|
||||
extra: Dict[Any, Any]
|
||||
source_expressions: List[Any]
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
output_field: Any = ...
|
||||
window_compatible: bool = ...
|
||||
|
||||
class FirstValue(Func):
|
||||
arity: int = ...
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
window_compatible: bool = ...
|
||||
|
||||
class LagLeadFunction(Func):
|
||||
window_compatible: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
expression: Optional[str],
|
||||
offset: int = ...,
|
||||
default: None = ...,
|
||||
**extra: Any
|
||||
) -> Any: ...
|
||||
|
||||
class Lag(LagLeadFunction):
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
|
||||
class LastValue(Func):
|
||||
arity: int = ...
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
window_compatible: bool = ...
|
||||
|
||||
class Lead(LagLeadFunction):
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
|
||||
class NthValue(Func):
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
window_compatible: bool = ...
|
||||
def __init__(
|
||||
self, expression: Optional[str], nth: int = ..., **extra: Any
|
||||
) -> Any: ...
|
||||
|
||||
class Ntile(Func):
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
output_field: Any = ...
|
||||
window_compatible: bool = ...
|
||||
def __init__(self, num_buckets: int = ..., **extra: Any) -> Any: ...
|
||||
|
||||
class PercentRank(Func):
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
output_field: Any = ...
|
||||
window_compatible: bool = ...
|
||||
|
||||
class Rank(Func):
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
output_field: Any = ...
|
||||
window_compatible: bool = ...
|
||||
|
||||
class RowNumber(Func):
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
output_field: Any = ...
|
||||
window_compatible: bool = ...
|
||||
38
django-stubs-generated/db/models/indexes.pyi
Normal file
38
django-stubs-generated/db/models/indexes.pyi
Normal file
@@ -0,0 +1,38 @@
|
||||
from typing import Any, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.db.backends.ddl_references import Statement
|
||||
from django.db.backends.sqlite3.schema import DatabaseSchemaEditor
|
||||
from django.db.models.base import Model
|
||||
|
||||
|
||||
class Index:
|
||||
model: Type[django.db.models.base.Model]
|
||||
suffix: str = ...
|
||||
max_name_length: int = ...
|
||||
fields: List[str] = ...
|
||||
fields_orders: List[Tuple[str, str]] = ...
|
||||
name: str = ...
|
||||
db_tablespace: Optional[str] = ...
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
fields: Any = ...,
|
||||
name: Optional[Any] = ...,
|
||||
db_tablespace: Optional[Any] = ...
|
||||
) -> None: ...
|
||||
def check_name(self) -> List[str]: ...
|
||||
def create_sql(
|
||||
self,
|
||||
model: Type[Model],
|
||||
schema_editor: DatabaseSchemaEditor,
|
||||
using: str = ...,
|
||||
) -> Statement: ...
|
||||
def remove_sql(
|
||||
self, model: Type[Model], schema_editor: DatabaseSchemaEditor
|
||||
) -> str: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[str, Tuple, Dict[str, Union[List[str], str]]]: ...
|
||||
def clone(self) -> Index: ...
|
||||
def set_name_with_model(self, model: Type[Model]) -> None: ...
|
||||
def __eq__(self, other: Index) -> bool: ...
|
||||
336
django-stubs-generated/db/models/lookups.pyi
Normal file
336
django-stubs-generated/db/models/lookups.pyi
Normal file
@@ -0,0 +1,336 @@
|
||||
from collections import OrderedDict
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict, List, Optional, Tuple, Type, Union, Iterable
|
||||
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.models import expressions, lookups
|
||||
from django.db.models.expressions import (Col, Combinable, Expression, Func,
|
||||
Ref)
|
||||
from django.db.models.fields import TextField, related_lookups
|
||||
from django.db.models.query_utils import RegisterLookupMixin
|
||||
from django.db.models.sql.compiler import SQLCompiler
|
||||
from django.db.models.sql.query import Query
|
||||
from django.utils.datastructures import OrderedSet
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
|
||||
class Lookup:
|
||||
lookup_name: Any = ...
|
||||
prepare_rhs: bool = ...
|
||||
can_use_none_as_rhs: bool = ...
|
||||
rhs: Any = ...
|
||||
bilateral_transforms: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
lhs: Union[Expression, TextField, related_lookups.MultiColSource],
|
||||
rhs: Any,
|
||||
) -> None: ...
|
||||
def apply_bilateral_transforms(self, value: Expression) -> Transform: ...
|
||||
def batch_process_rhs(
|
||||
self,
|
||||
compiler: SQLCompiler,
|
||||
connection: DatabaseWrapper,
|
||||
rhs: Optional[OrderedSet] = ...,
|
||||
) -> Tuple[List[str], List[str]]: ...
|
||||
def get_source_expressions(self) -> List[Expression]: ...
|
||||
lhs: Any = ...
|
||||
def set_source_expressions(self, new_exprs: List[Ref]) -> None: ...
|
||||
def get_prep_lookup(self) -> Any: ...
|
||||
def get_db_prep_lookup(
|
||||
self, value: Union[int, str], connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[SafeText]]: ...
|
||||
def process_lhs(
|
||||
self,
|
||||
compiler: SQLCompiler,
|
||||
connection: DatabaseWrapper,
|
||||
lhs: Optional[Col] = ...,
|
||||
) -> Tuple[str, List[Union[int, str]]]: ...
|
||||
def process_rhs(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, Union[List[Union[int, str]], Tuple[int, int]]]: ...
|
||||
def rhs_is_direct_value(self) -> bool: ...
|
||||
def relabeled_clone(
|
||||
self, relabels: Union[Dict[Optional[str], str], OrderedDict]
|
||||
) -> Union[BuiltinLookup, FieldGetDbPrepValueMixin]: ...
|
||||
def get_group_by_cols(self) -> List[Expression]: ...
|
||||
def as_sql(self, compiler: Any, connection: Any) -> None: ...
|
||||
def contains_aggregate(self) -> bool: ...
|
||||
def contains_over_clause(self) -> bool: ...
|
||||
@property
|
||||
def is_summary(self): ...
|
||||
|
||||
class Transform(RegisterLookupMixin, Func):
|
||||
bilateral: bool = ...
|
||||
arity: int = ...
|
||||
@property
|
||||
def lhs(self) -> Expression: ...
|
||||
def get_bilateral_transforms(self) -> List[Type[Transform]]: ...
|
||||
|
||||
class BuiltinLookup(Lookup):
|
||||
def process_lhs(
|
||||
self,
|
||||
compiler: SQLCompiler,
|
||||
connection: DatabaseWrapper,
|
||||
lhs: Optional[Col] = ...,
|
||||
) -> Tuple[str, List[Union[int, str]]]: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[float]]: ...
|
||||
def get_rhs_op(self, connection: DatabaseWrapper, rhs: str) -> str: ...
|
||||
|
||||
class FieldGetDbPrepValueMixin:
|
||||
get_db_prep_lookup_value_is_iterable: bool = ...
|
||||
def get_db_prep_lookup(
|
||||
self, value: Any, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[float]]: ...
|
||||
|
||||
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 resolve_expression_parameter(
|
||||
self,
|
||||
compiler: SQLCompiler,
|
||||
connection: DatabaseWrapper,
|
||||
sql: str,
|
||||
param: Optional[Union[Combinable, int, str]],
|
||||
) -> Tuple[str, List[None]]: ...
|
||||
def batch_process_rhs(
|
||||
self,
|
||||
compiler: SQLCompiler,
|
||||
connection: DatabaseWrapper,
|
||||
rhs: Optional[OrderedSet] = ...,
|
||||
) -> Tuple[Tuple[str], Tuple]: ...
|
||||
|
||||
class Exact(FieldGetDbPrepValueMixin, BuiltinLookup):
|
||||
bilateral_transforms: List[Type[lookups.Transform]]
|
||||
contains_aggregate: bool
|
||||
contains_over_clause: bool
|
||||
lhs: Expression
|
||||
rhs: Any
|
||||
lookup_name: str = ...
|
||||
def process_rhs(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, Union[List[str], Tuple[int, int]]]: ...
|
||||
|
||||
class IExact(BuiltinLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
contains_aggregate: bool
|
||||
lhs: expressions.Col
|
||||
rhs: Optional[Union[expressions.Col, str]]
|
||||
lookup_name: str = ...
|
||||
prepare_rhs: bool = ...
|
||||
def process_rhs(
|
||||
self, qn: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[str]]: ...
|
||||
|
||||
class GreaterThan(FieldGetDbPrepValueMixin, BuiltinLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
contains_aggregate: bool
|
||||
lhs: Expression
|
||||
rhs: Any
|
||||
lookup_name: str = ...
|
||||
|
||||
class GreaterThanOrEqual(FieldGetDbPrepValueMixin, BuiltinLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
contains_aggregate: bool
|
||||
lhs: Expression
|
||||
rhs: Any
|
||||
lookup_name: str = ...
|
||||
|
||||
class LessThan(FieldGetDbPrepValueMixin, BuiltinLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
contains_aggregate: bool
|
||||
lhs: Expression
|
||||
rhs: Any
|
||||
lookup_name: str = ...
|
||||
|
||||
class LessThanOrEqual(FieldGetDbPrepValueMixin, BuiltinLookup):
|
||||
bilateral_transforms: List[Type[lookups.Transform]]
|
||||
contains_aggregate: bool
|
||||
contains_over_clause: bool
|
||||
lhs: Expression
|
||||
rhs: Any
|
||||
lookup_name: str = ...
|
||||
|
||||
class IntegerFieldFloatRounding:
|
||||
rhs: Any = ...
|
||||
def get_prep_lookup(self) -> Union[Combinable, Query, int]: ...
|
||||
|
||||
class IntegerGreaterThanOrEqual(
|
||||
IntegerFieldFloatRounding, GreaterThanOrEqual
|
||||
): ...
|
||||
class IntegerLessThan(IntegerFieldFloatRounding, LessThan): ...
|
||||
|
||||
class In(FieldGetDbPrepValueIterableMixin, BuiltinLookup):
|
||||
bilateral_transforms: List[Type[lookups.Transform]]
|
||||
contains_aggregate: bool
|
||||
lhs: Expression
|
||||
rhs: Any
|
||||
lookup_name: str = ...
|
||||
def process_rhs(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, Tuple]: ...
|
||||
def get_rhs_op(self, connection: DatabaseWrapper, rhs: str) -> str: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Union[int, str]]]: ...
|
||||
def split_parameter_list_as_sql(self, compiler: Any, connection: Any): ...
|
||||
|
||||
class PatternLookup(BuiltinLookup):
|
||||
param_pattern: str = ...
|
||||
prepare_rhs: bool = ...
|
||||
def get_rhs_op(self, connection: DatabaseWrapper, rhs: str) -> str: ...
|
||||
def process_rhs(
|
||||
self, qn: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Any]]: ...
|
||||
|
||||
class Contains(PatternLookup):
|
||||
bilateral_transforms: List[Type[lookups.Transform]]
|
||||
contains_aggregate: bool
|
||||
lhs: Expression
|
||||
rhs: Union[Expression, str]
|
||||
lookup_name: str = ...
|
||||
|
||||
class IContains(Contains):
|
||||
bilateral_transforms: List[Any]
|
||||
contains_aggregate: bool
|
||||
lhs: expressions.Col
|
||||
rhs: Union[Expression, str]
|
||||
lookup_name: str = ...
|
||||
|
||||
class StartsWith(PatternLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
contains_aggregate: bool
|
||||
lhs: expressions.Col
|
||||
rhs: Union[Expression, str]
|
||||
lookup_name: str = ...
|
||||
param_pattern: str = ...
|
||||
|
||||
class IStartsWith(StartsWith):
|
||||
bilateral_transforms: List[Any]
|
||||
contains_aggregate: bool
|
||||
lhs: expressions.Col
|
||||
rhs: Union[Expression, str]
|
||||
lookup_name: str = ...
|
||||
|
||||
class EndsWith(PatternLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
contains_aggregate: bool
|
||||
lhs: expressions.Col
|
||||
rhs: Union[Expression, str]
|
||||
lookup_name: str = ...
|
||||
param_pattern: str = ...
|
||||
|
||||
class IEndsWith(EndsWith):
|
||||
bilateral_transforms: List[Any]
|
||||
contains_aggregate: bool
|
||||
lhs: expressions.Col
|
||||
rhs: Union[Expression, str]
|
||||
lookup_name: str = ...
|
||||
|
||||
class Range(FieldGetDbPrepValueIterableMixin, BuiltinLookup):
|
||||
bilateral_transforms: List[Type[lookups.Transform]]
|
||||
contains_aggregate: bool
|
||||
lhs: Expression
|
||||
rhs: Union[
|
||||
List[datetime.datetime],
|
||||
Tuple[
|
||||
Union[expressions.F, int],
|
||||
Union[datetime.datetime, int],
|
||||
],
|
||||
]
|
||||
lookup_name: str = ...
|
||||
def get_rhs_op(
|
||||
self, connection: DatabaseWrapper, rhs: Tuple[str, str]
|
||||
) -> str: ...
|
||||
|
||||
class IsNull(BuiltinLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
contains_aggregate: bool
|
||||
lhs: Expression
|
||||
rhs: bool
|
||||
lookup_name: str = ...
|
||||
prepare_rhs: bool = ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Any]]: ...
|
||||
|
||||
class Regex(BuiltinLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
contains_aggregate: bool
|
||||
lhs: expressions.Col
|
||||
rhs: str
|
||||
lookup_name: str = ...
|
||||
prepare_rhs: bool = ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[str]]: ...
|
||||
|
||||
class IRegex(Regex):
|
||||
bilateral_transforms: List[Any]
|
||||
contains_aggregate: bool
|
||||
lhs: expressions.Col
|
||||
rhs: str
|
||||
lookup_name: str = ...
|
||||
|
||||
class YearLookup(Lookup):
|
||||
def year_lookup_bounds(
|
||||
self, connection: DatabaseWrapper, year: int
|
||||
) -> List[str]: ...
|
||||
|
||||
class YearComparisonLookup(YearLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
lhs: expressions.Value
|
||||
rhs: expressions.Value
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[str]]: ...
|
||||
def get_rhs_op(self, connection: DatabaseWrapper, rhs: str) -> str: ...
|
||||
def get_bound(self, start: datetime, finish: datetime) -> Any: ...
|
||||
|
||||
class YearExact(YearLookup, Exact):
|
||||
bilateral_transforms: List[Any]
|
||||
contains_aggregate: bool
|
||||
lhs: django.db.models.functions.datetime.ExtractYear
|
||||
rhs: Union[django.db.models.functions.datetime.Extract, int, str]
|
||||
lookup_name: str = ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[str]]: ...
|
||||
|
||||
class YearGt(YearComparisonLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
contains_aggregate: bool
|
||||
lhs: django.db.models.functions.datetime.ExtractYear
|
||||
rhs: int
|
||||
lookup_name: str = ...
|
||||
def get_bound(self, start: str, finish: str) -> str: ...
|
||||
|
||||
class YearGte(YearComparisonLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
contains_aggregate: bool
|
||||
lhs: django.db.models.functions.datetime.ExtractYear
|
||||
rhs: int
|
||||
lookup_name: str = ...
|
||||
def get_bound(self, start: str, finish: str) -> str: ...
|
||||
|
||||
class YearLt(YearComparisonLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
contains_aggregate: bool
|
||||
lhs: django.db.models.functions.datetime.ExtractYear
|
||||
rhs: int
|
||||
lookup_name: str = ...
|
||||
def get_bound(self, start: str, finish: str) -> str: ...
|
||||
|
||||
class YearLte(YearComparisonLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
contains_aggregate: bool
|
||||
lhs: django.db.models.functions.datetime.ExtractYear
|
||||
rhs: int
|
||||
lookup_name: str = ...
|
||||
def get_bound(self, start: str, finish: str) -> str: ...
|
||||
154
django-stubs-generated/db/models/manager.pyi
Normal file
154
django-stubs-generated/db/models/manager.pyi
Normal file
@@ -0,0 +1,154 @@
|
||||
from collections import OrderedDict
|
||||
from datetime import date, datetime
|
||||
from decimal import Decimal
|
||||
from typing import Any, Dict, List, Optional, Tuple, Type, Union, TypeVar, Set, Generic
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
from django.contrib.sites.managers import CurrentSiteManager
|
||||
from django.db.models import Q
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.query import QuerySet, RawQuerySet
|
||||
|
||||
_T = TypeVar('_T', bound=Model)
|
||||
|
||||
|
||||
class BaseManager:
|
||||
creation_counter: int = ...
|
||||
auto_created: bool = ...
|
||||
use_in_migrations: bool = ...
|
||||
def __new__(cls: Type[Manager], *args: Any, **kwargs: Any) -> Manager: ...
|
||||
model: Any = ...
|
||||
name: Any = ...
|
||||
def __init__(self) -> None: ...
|
||||
def deconstruct(self) -> Tuple[bool, str, None, Tuple, Dict[str, int]]: ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
@classmethod
|
||||
def from_queryset(
|
||||
cls, queryset_class: Any, class_name: Optional[Any] = ...
|
||||
): ...
|
||||
def contribute_to_class(self, model: Type[Model], name: str) -> None: ...
|
||||
def db_manager(
|
||||
self,
|
||||
using: Optional[str] = ...,
|
||||
hints: Optional[Dict[str, Model]] = ...,
|
||||
) -> Manager: ...
|
||||
@property
|
||||
def db(self) -> str: ...
|
||||
def get_queryset(self) -> QuerySet: ...
|
||||
def all(self) -> QuerySet: ...
|
||||
def __eq__(self, other: Optional[CurrentSiteManager]) -> bool: ...
|
||||
def __hash__(self): ...
|
||||
|
||||
class Manager(Generic[_T]):
|
||||
def exists(self) -> bool: ...
|
||||
|
||||
def explain(
|
||||
self, *, format: Optional[Any] = ..., **options: Any
|
||||
) -> str: ...
|
||||
|
||||
def raw(
|
||||
self,
|
||||
raw_query: str,
|
||||
params: Optional[
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[datetime],
|
||||
List[Decimal],
|
||||
List[str],
|
||||
Set[str],
|
||||
Tuple[int],
|
||||
]
|
||||
] = ...,
|
||||
translations: Optional[Dict[str, str]] = ...,
|
||||
using: None = ...,
|
||||
) -> RawQuerySet: ...
|
||||
|
||||
def values(self, *fields: Any, **expressions: Any) -> QuerySet: ...
|
||||
|
||||
def values_list(
|
||||
self, *fields: Any, flat: bool = ..., named: bool = ...
|
||||
) -> QuerySet: ...
|
||||
|
||||
def dates(
|
||||
self, field_name: str, kind: str, order: str = ...
|
||||
) -> QuerySet: ...
|
||||
|
||||
def datetimes(
|
||||
self, field_name: str, kind: str, order: str = ..., tzinfo: None = ...
|
||||
) -> QuerySet: ...
|
||||
|
||||
def none(self) -> QuerySet[_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 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]: ...
|
||||
|
||||
def select_for_update(
|
||||
self, nowait: bool = ..., skip_locked: bool = ..., of: Tuple = ...
|
||||
) -> QuerySet: ...
|
||||
|
||||
def select_related(self, *fields: Any) -> QuerySet[_T]: ...
|
||||
|
||||
def prefetch_related(self, *lookups: Any) -> QuerySet[_T]: ...
|
||||
|
||||
def annotate(self, *args: Any, **kwargs: Any) -> QuerySet[_T]: ...
|
||||
|
||||
def order_by(self, *field_names: Any) -> QuerySet[_T]: ...
|
||||
|
||||
def distinct(self, *field_names: Any) -> QuerySet[_T]: ...
|
||||
|
||||
def extra(
|
||||
self,
|
||||
select: Optional[
|
||||
Union[Dict[str, int], Dict[str, str], OrderedDict]
|
||||
] = ...,
|
||||
where: Optional[List[str]] = ...,
|
||||
params: Optional[Union[List[int], List[str]]] = ...,
|
||||
tables: Optional[List[str]] = ...,
|
||||
order_by: Optional[Union[List[str], Tuple[str]]] = ...,
|
||||
select_params: Optional[Union[List[int], List[str], Tuple[int]]] = ...,
|
||||
) -> QuerySet[_T]: ...
|
||||
|
||||
def iterator(self, chunk_size: int = ...) -> Iterator[_T]: ...
|
||||
|
||||
def aggregate(
|
||||
self, *args: Any, **kwargs: Any
|
||||
) -> Dict[str, Optional[Union[datetime, float]]]: ...
|
||||
|
||||
def count(self) -> int: ...
|
||||
|
||||
def get(
|
||||
self, *args: Any, **kwargs: Any
|
||||
) -> _T: ...
|
||||
|
||||
def create(self, **kwargs: Any) -> _T: ...
|
||||
|
||||
|
||||
class ManagerDescriptor:
|
||||
manager: Manager = ...
|
||||
def __init__(self, manager: Manager) -> None: ...
|
||||
def __get__(
|
||||
self, instance: Optional[Model], cls: Type[Model] = ...
|
||||
) -> Manager: ...
|
||||
|
||||
class EmptyManager(Manager):
|
||||
creation_counter: int
|
||||
name: None
|
||||
model: Optional[Type[Model]] = ...
|
||||
def __init__(self, model: Type[Model]) -> None: ...
|
||||
def get_queryset(self) -> QuerySet: ...
|
||||
161
django-stubs-generated/db/models/options.pyi
Normal file
161
django-stubs-generated/db/models/options.pyi
Normal file
@@ -0,0 +1,161 @@
|
||||
from typing import (Any, Callable, Dict, Iterator, List, Optional, Set, Tuple,
|
||||
Type, Union)
|
||||
|
||||
from django.apps.config import AppConfig
|
||||
from django.contrib.auth.base_user import AbstractBaseUser
|
||||
from django.contrib.auth.models import AbstractUser, PermissionsMixin
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
from django.contrib.postgres.fields.array import ArrayField
|
||||
from django.contrib.postgres.fields.citext import CIText
|
||||
from django.contrib.sessions.base_session import AbstractBaseSession
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.fields import Field
|
||||
from django.db.models.fields.mixins import FieldCacheMixin
|
||||
from django.db.models.fields.related import OneToOneField
|
||||
from django.db.models.fields.reverse_related import ForeignObjectRel
|
||||
from django.db.models.manager import Manager
|
||||
from django.db.models.query_utils import PathInfo
|
||||
from django.utils.datastructures import ImmutableList
|
||||
|
||||
PROXY_PARENTS: Any
|
||||
EMPTY_RELATION_TREE: Any
|
||||
IMMUTABLE_WARNING: str
|
||||
DEFAULT_NAMES: Any
|
||||
|
||||
def normalize_together(
|
||||
option_together: Any
|
||||
) -> Union[
|
||||
List[Union[Tuple[str, str], int]], Set[Tuple[str, str]], Tuple, int, str
|
||||
]: ...
|
||||
def make_immutable_fields_list(
|
||||
name: str,
|
||||
data: Union[
|
||||
Iterator[Any],
|
||||
List[Union[ArrayField, CIText]],
|
||||
List[Union[Field, FieldCacheMixin]],
|
||||
],
|
||||
) -> ImmutableList: ...
|
||||
|
||||
class Options:
|
||||
base_manager: django.db.models.manager.Manager
|
||||
concrete_fields: django.utils.datastructures.ImmutableList
|
||||
default_manager: django.db.models.manager.Manager
|
||||
fields: django.utils.datastructures.ImmutableList
|
||||
local_concrete_fields: django.utils.datastructures.ImmutableList
|
||||
managers: django.utils.datastructures.ImmutableList
|
||||
managers_map: Dict[str, django.db.models.manager.Manager]
|
||||
related_objects: django.utils.datastructures.ImmutableList
|
||||
FORWARD_PROPERTIES: Any = ...
|
||||
REVERSE_PROPERTIES: Any = ...
|
||||
default_apps: Any = ...
|
||||
local_fields: List[django.db.models.fields.Field] = ...
|
||||
local_many_to_many: List[
|
||||
django.db.models.fields.related.ManyToManyField
|
||||
] = ...
|
||||
private_fields: List[Any] = ...
|
||||
local_managers: List[django.db.models.manager.Manager] = ...
|
||||
base_manager_name: None = ...
|
||||
default_manager_name: None = ...
|
||||
model_name: Optional[str] = ...
|
||||
verbose_name: Optional[str] = ...
|
||||
verbose_name_plural: Optional[str] = ...
|
||||
db_table: str = ...
|
||||
ordering: List[str] = ...
|
||||
indexes: List[Any] = ...
|
||||
unique_together: Union[List[Any], Tuple] = ...
|
||||
index_together: Union[List[Any], Tuple] = ...
|
||||
select_on_save: bool = ...
|
||||
default_permissions: Tuple[str, str, str, str] = ...
|
||||
permissions: List[Any] = ...
|
||||
object_name: Optional[str] = ...
|
||||
app_label: str = ...
|
||||
get_latest_by: None = ...
|
||||
order_with_respect_to: None = ...
|
||||
db_tablespace: str = ...
|
||||
required_db_features: List[Any] = ...
|
||||
required_db_vendor: None = ...
|
||||
meta: Optional[
|
||||
Type[
|
||||
Union[
|
||||
django.contrib.auth.base_user.AbstractBaseUser.Meta,
|
||||
django.contrib.auth.models.AbstractUser.Meta,
|
||||
django.contrib.auth.models.PermissionsMixin.Meta,
|
||||
django.contrib.sessions.base_session.AbstractBaseSession.Meta,
|
||||
]
|
||||
]
|
||||
] = ...
|
||||
pk: Optional[django.db.models.fields.Field] = ...
|
||||
auto_field: Optional[django.db.models.fields.AutoField] = ...
|
||||
abstract: bool = ...
|
||||
managed: bool = ...
|
||||
proxy: bool = ...
|
||||
proxy_for_model: None = ...
|
||||
concrete_model: Optional[Type[django.db.models.base.Model]] = ...
|
||||
swappable: None = ...
|
||||
parents: collections.OrderedDict = ...
|
||||
auto_created: bool = ...
|
||||
related_fkey_lookups: List[Any] = ...
|
||||
apps: django.apps.registry.Apps = ...
|
||||
default_related_name: None = ...
|
||||
def __init__(
|
||||
self,
|
||||
meta: Optional[
|
||||
Type[
|
||||
Union[
|
||||
AbstractBaseUser.Meta,
|
||||
AbstractUser.Meta,
|
||||
PermissionsMixin.Meta,
|
||||
AbstractBaseSession.Meta,
|
||||
]
|
||||
]
|
||||
],
|
||||
app_label: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
@property
|
||||
def label(self) -> str: ...
|
||||
@property
|
||||
def label_lower(self) -> str: ...
|
||||
@property
|
||||
def app_config(self) -> AppConfig: ...
|
||||
@property
|
||||
def installed(self): ...
|
||||
model: Type[django.db.models.base.Model] = ...
|
||||
original_attrs: Dict[
|
||||
str, Union[List[str], django.apps.registry.Apps, str]
|
||||
] = ...
|
||||
def contribute_to_class(self, cls: Type[Model], name: str) -> None: ...
|
||||
def add_manager(self, manager: Manager) -> None: ...
|
||||
def add_field(
|
||||
self, field: Union[GenericForeignKey, Field], private: bool = ...
|
||||
) -> None: ...
|
||||
def setup_pk(self, field: Field) -> None: ...
|
||||
def setup_proxy(self, target: Type[Model]) -> None: ...
|
||||
def can_migrate(self, connection: Union[DatabaseWrapper, str]) -> bool: ...
|
||||
@property
|
||||
def verbose_name_raw(self) -> Any: ...
|
||||
@property
|
||||
def swapped(self) -> Optional[str]: ...
|
||||
def managers(self) -> ImmutableList: ...
|
||||
def managers_map(self) -> Dict[str, Manager]: ...
|
||||
def base_manager(self) -> Manager: ...
|
||||
def default_manager(self) -> Manager: ...
|
||||
def fields(self) -> ImmutableList: ...
|
||||
def concrete_fields(self) -> ImmutableList: ...
|
||||
def local_concrete_fields(self) -> ImmutableList: ...
|
||||
def many_to_many(self) -> ImmutableList: ...
|
||||
def related_objects(self) -> ImmutableList: ...
|
||||
def fields_map(self) -> Dict[str, ForeignObjectRel]: ...
|
||||
def get_field(
|
||||
self, field_name: Union[Callable, str]
|
||||
) -> Union[Field, mixins.FieldCacheMixin]: ...
|
||||
def get_base_chain(self, model: Type[Model]) -> List[Type[Model]]: ...
|
||||
def get_parent_list(self) -> List[Type[Model]]: ...
|
||||
def get_ancestor_link(
|
||||
self, ancestor: Type[Model]
|
||||
) -> Optional[OneToOneField]: ...
|
||||
def get_path_to_parent(self, parent: Type[Model]) -> List[PathInfo]: ...
|
||||
def get_path_from_parent(self, parent: Type[Model]) -> List[PathInfo]: ...
|
||||
def get_fields(
|
||||
self, include_parents: bool = ..., include_hidden: bool = ...
|
||||
) -> ImmutableList: ...
|
||||
450
django-stubs-generated/db/models/query.pyi
Normal file
450
django-stubs-generated/db/models/query.pyi
Normal file
@@ -0,0 +1,450 @@
|
||||
import decimal
|
||||
import operator
|
||||
from collections import OrderedDict
|
||||
from datetime import date, datetime
|
||||
from decimal import Decimal
|
||||
from itertools import chain
|
||||
from typing import (Any, Callable, Dict, Iterator, List, Optional, Set, Tuple,
|
||||
Type, Union, Generic, TypeVar, overload)
|
||||
from unittest.mock import MagicMock
|
||||
from uuid import UUID
|
||||
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
from django.db import models
|
||||
from django.db.models.base import Model, ModelState
|
||||
from django.db.models.expressions import Expression
|
||||
from django.db.models.fields import Field
|
||||
from django.db.models.fields.related_descriptors import (ForwardManyToOneDescriptor,
|
||||
ReverseOneToOneDescriptor)
|
||||
from django.db.models.query_utils import Q
|
||||
from django.db.models.sql.query import Query, RawQuery
|
||||
|
||||
REPR_OUTPUT_SIZE: int
|
||||
EmptyResultSet: Any
|
||||
|
||||
|
||||
class BaseIterable:
|
||||
queryset: Any = ...
|
||||
chunked_fetch: Any = ...
|
||||
chunk_size: Any = ...
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
queryset: QuerySet,
|
||||
chunked_fetch: bool = ...,
|
||||
chunk_size: int = ...,
|
||||
) -> None: ...
|
||||
|
||||
|
||||
class ModelIterable(BaseIterable):
|
||||
chunk_size: int
|
||||
chunked_fetch: bool
|
||||
queryset: QuerySet
|
||||
|
||||
def __iter__(self) -> Iterator[Model]: ...
|
||||
|
||||
|
||||
class ValuesIterable(BaseIterable):
|
||||
chunk_size: int
|
||||
chunked_fetch: bool
|
||||
queryset: QuerySet
|
||||
|
||||
def __iter__(self) -> Iterator[Dict[str, Optional[Union[int, str]]]]: ...
|
||||
|
||||
|
||||
class ValuesListIterable(BaseIterable):
|
||||
chunk_size: int
|
||||
chunked_fetch: bool
|
||||
queryset: QuerySet
|
||||
|
||||
def __iter__(self) -> Union[chain, map]: ...
|
||||
|
||||
|
||||
class NamedValuesListIterable(ValuesListIterable):
|
||||
chunk_size: int
|
||||
chunked_fetch: bool
|
||||
queryset: QuerySet
|
||||
|
||||
@staticmethod
|
||||
def create_namedtuple_class(*names: Any) -> Any: ...
|
||||
|
||||
def __iter__(self) -> Any: ...
|
||||
|
||||
|
||||
class FlatValuesListIterable(BaseIterable):
|
||||
chunk_size: int
|
||||
chunked_fetch: bool
|
||||
queryset: QuerySet
|
||||
|
||||
def __iter__(self) -> Iterator[Any]: ...
|
||||
|
||||
|
||||
_T = TypeVar('_T', bound=models.Model)
|
||||
|
||||
|
||||
class QuerySet(Generic[_T]):
|
||||
model: Optional[Type[models.Model]] = ...
|
||||
query: models.sql.Query = ...
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
model: Optional[Type[Model]] = ...,
|
||||
query: Optional[Query] = ...,
|
||||
using: Optional[str] = ...,
|
||||
hints: Optional[Dict[str, Model]] = ...,
|
||||
) -> None: ...
|
||||
|
||||
def as_manager(cls): ...
|
||||
|
||||
def __deepcopy__(
|
||||
self,
|
||||
memo: Dict[
|
||||
int,
|
||||
Union[
|
||||
Dict[str, Union[ModelState, int, str]],
|
||||
List[Union[Dict[str, Union[bool, str]], ModelState]],
|
||||
Model,
|
||||
ModelState,
|
||||
],
|
||||
],
|
||||
) -> QuerySet[_T]: ...
|
||||
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
def __iter__(self) -> Iterator[_T]: ...
|
||||
|
||||
def __bool__(self) -> bool: ...
|
||||
|
||||
@overload
|
||||
def __getitem__(self, k: slice) -> QuerySet[_T]: ...
|
||||
|
||||
@overload
|
||||
def __getitem__(self, k: int) -> _T: ...
|
||||
|
||||
@overload
|
||||
def __getitem__(self, k: str) -> Any: ...
|
||||
|
||||
def __and__(self, other: QuerySet) -> QuerySet: ...
|
||||
|
||||
def __or__(self, other: QuerySet) -> QuerySet: ...
|
||||
|
||||
def iterator(self, chunk_size: int = ...) -> Iterator[_T]: ...
|
||||
|
||||
def aggregate(
|
||||
self, *args: Any, **kwargs: Any
|
||||
) -> Dict[str, Optional[Union[datetime, float]]]: ...
|
||||
|
||||
def count(self) -> int: ...
|
||||
|
||||
def get(
|
||||
self, *args: Any, **kwargs: Any
|
||||
) -> _T: ...
|
||||
|
||||
def create(self, **kwargs: Any) -> _T: ...
|
||||
|
||||
def bulk_create(
|
||||
self,
|
||||
objs: Union[Iterator[Any], List[Model]],
|
||||
batch_size: Optional[int] = ...,
|
||||
) -> List[_T]: ...
|
||||
|
||||
def get_or_create(
|
||||
self,
|
||||
defaults: Optional[Union[Dict[str, date], Dict[str, Model]]] = ...,
|
||||
**kwargs: Any
|
||||
) -> Tuple[_T, bool]: ...
|
||||
|
||||
def update_or_create(
|
||||
self,
|
||||
defaults: Optional[
|
||||
Union[
|
||||
Dict[str, Callable],
|
||||
Dict[str, date],
|
||||
Dict[str, Model],
|
||||
Dict[str, str],
|
||||
]
|
||||
] = ...,
|
||||
**kwargs: Any
|
||||
) -> Tuple[_T, bool]: ...
|
||||
|
||||
def earliest(
|
||||
self, *fields: Any, field_name: Optional[Any] = ...
|
||||
) -> _T: ...
|
||||
|
||||
def latest(
|
||||
self, *fields: Any, field_name: Optional[Any] = ...
|
||||
) -> _T: ...
|
||||
|
||||
def first(self) -> Optional[Union[Dict[str, int], _T]]: ...
|
||||
|
||||
def last(self) -> Optional[_T]: ...
|
||||
|
||||
def in_bulk(
|
||||
self, id_list: Any = ..., *, field_name: str = ...
|
||||
) -> Union[Dict[int, Model], Dict[str, Model]]: ...
|
||||
|
||||
def delete(self) -> Tuple[int, Dict[str, int]]: ...
|
||||
|
||||
def update(self, **kwargs: Any) -> int: ...
|
||||
|
||||
def exists(self) -> bool: ...
|
||||
|
||||
def explain(
|
||||
self, *, format: Optional[Any] = ..., **options: Any
|
||||
) -> str: ...
|
||||
|
||||
def raw(
|
||||
self,
|
||||
raw_query: str,
|
||||
params: Optional[
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[datetime],
|
||||
List[Decimal],
|
||||
List[str],
|
||||
Set[str],
|
||||
Tuple[int],
|
||||
]
|
||||
] = ...,
|
||||
translations: Optional[Dict[str, str]] = ...,
|
||||
using: None = ...,
|
||||
) -> RawQuerySet: ...
|
||||
|
||||
def values(self, *fields: Any, **expressions: Any) -> QuerySet: ...
|
||||
|
||||
def values_list(
|
||||
self, *fields: Any, flat: bool = ..., named: bool = ...
|
||||
) -> QuerySet: ...
|
||||
|
||||
def dates(
|
||||
self, field_name: str, kind: str, order: str = ...
|
||||
) -> QuerySet: ...
|
||||
|
||||
def datetimes(
|
||||
self, field_name: str, kind: str, order: str = ..., tzinfo: None = ...
|
||||
) -> QuerySet: ...
|
||||
|
||||
def none(self) -> QuerySet[_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 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]: ...
|
||||
|
||||
def select_for_update(
|
||||
self, nowait: bool = ..., skip_locked: bool = ..., of: Tuple = ...
|
||||
) -> QuerySet: ...
|
||||
|
||||
def select_related(self, *fields: Any) -> QuerySet[_T]: ...
|
||||
|
||||
def prefetch_related(self, *lookups: Any) -> QuerySet[_T]: ...
|
||||
|
||||
def annotate(self, *args: Any, **kwargs: Any) -> QuerySet[_T]: ...
|
||||
|
||||
def order_by(self, *field_names: Any) -> QuerySet[_T]: ...
|
||||
|
||||
def distinct(self, *field_names: Any) -> QuerySet[_T]: ...
|
||||
|
||||
def extra(
|
||||
self,
|
||||
select: Optional[
|
||||
Union[Dict[str, int], Dict[str, str], OrderedDict]
|
||||
] = ...,
|
||||
where: Optional[List[str]] = ...,
|
||||
params: Optional[Union[List[int], List[str]]] = ...,
|
||||
tables: Optional[List[str]] = ...,
|
||||
order_by: Optional[Union[List[str], Tuple[str]]] = ...,
|
||||
select_params: Optional[Union[List[int], List[str], Tuple[int]]] = ...,
|
||||
) -> QuerySet[_T]: ...
|
||||
|
||||
def reverse(self) -> QuerySet[_T]: ...
|
||||
|
||||
def defer(self, *fields: Any) -> QuerySet[_T]: ...
|
||||
|
||||
def only(self, *fields: Any) -> QuerySet[_T]: ...
|
||||
|
||||
def using(self, alias: Optional[str]) -> QuerySet[_T]: ...
|
||||
|
||||
@property
|
||||
def ordered(self) -> bool: ...
|
||||
|
||||
@property
|
||||
def db(self) -> str: ...
|
||||
|
||||
def resolve_expression(self, *args: Any, **kwargs: Any) -> Query: ...
|
||||
|
||||
|
||||
class InstanceCheckMeta(type):
|
||||
def __instancecheck__(self, instance: Union[QuerySet, str]) -> bool: ...
|
||||
|
||||
|
||||
class EmptyQuerySet:
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
|
||||
|
||||
class RawQuerySet:
|
||||
columns: List[str]
|
||||
model_fields: Dict[str, models.Field]
|
||||
raw_query: str = ...
|
||||
model: Optional[Type[models.Model]] = ...
|
||||
query: models.sql.RawQuery = ...
|
||||
params: Union[
|
||||
Dict[str, str],
|
||||
List[datetime],
|
||||
List[decimal.Decimal],
|
||||
List[str],
|
||||
Set[str],
|
||||
Tuple,
|
||||
] = ...
|
||||
translations: Dict[str, str] = ...
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
raw_query: str,
|
||||
model: Optional[Type[Model]] = ...,
|
||||
query: Optional[RawQuery] = ...,
|
||||
params: Optional[
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[datetime],
|
||||
List[Decimal],
|
||||
List[str],
|
||||
Set[str],
|
||||
Tuple,
|
||||
]
|
||||
] = ...,
|
||||
translations: Optional[Dict[str, str]] = ...,
|
||||
using: Optional[str] = ...,
|
||||
hints: Optional[Dict[Any, Any]] = ...,
|
||||
) -> None: ...
|
||||
|
||||
def resolve_model_init_order(
|
||||
self
|
||||
) -> Tuple[List[str], List[int], List[Tuple[str, int]]]: ...
|
||||
|
||||
def prefetch_related(self, *lookups: Any) -> RawQuerySet: ...
|
||||
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
def __bool__(self) -> bool: ...
|
||||
|
||||
def __iter__(self) -> Any: ...
|
||||
|
||||
def iterator(self) -> Iterator[Model]: ...
|
||||
|
||||
def __getitem__(
|
||||
self, k: Union[int, slice, str]
|
||||
) -> Union[List[Model], Model]: ...
|
||||
|
||||
@property
|
||||
def db(self) -> str: ...
|
||||
|
||||
def using(self, alias: Any): ...
|
||||
|
||||
def columns(self) -> List[str]: ...
|
||||
|
||||
def model_fields(self) -> Dict[str, Field]: ...
|
||||
|
||||
|
||||
class Prefetch:
|
||||
prefetch_through: str = ...
|
||||
prefetch_to: str = ...
|
||||
queryset: Optional[QuerySet] = ...
|
||||
to_attr: Optional[str] = ...
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
lookup: str,
|
||||
queryset: Optional[QuerySet] = ...,
|
||||
to_attr: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
|
||||
def add_prefix(self, prefix: str) -> None: ...
|
||||
|
||||
def get_current_prefetch_to(self, level: int) -> str: ...
|
||||
|
||||
def get_current_to_attr(self, level: int) -> Tuple[str, Optional[bool]]: ...
|
||||
|
||||
def get_current_queryset(self, level: int) -> Optional[QuerySet]: ...
|
||||
|
||||
def __eq__(self, other: None) -> bool: ...
|
||||
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
|
||||
def normalize_prefetch_lookups(
|
||||
lookups: reversed, prefix: None = ...
|
||||
) -> List[Prefetch]: ...
|
||||
|
||||
|
||||
def prefetch_related_objects(
|
||||
model_instances: Union[List[Model], List[UUID]], *related_lookups: Any
|
||||
) -> None: ...
|
||||
|
||||
|
||||
def get_prefetcher(
|
||||
instance: Model, through_attr: str, to_attr: str
|
||||
) -> Tuple[
|
||||
GenericForeignKey, Union[GenericForeignKey, property], bool, bool
|
||||
]: ...
|
||||
|
||||
|
||||
def prefetch_one_level(
|
||||
instances: List[Model],
|
||||
prefetcher: Union[
|
||||
GenericForeignKey, ForwardManyToOneDescriptor, ReverseOneToOneDescriptor
|
||||
],
|
||||
lookup: Prefetch,
|
||||
level: int,
|
||||
) -> Tuple[List[Model], List[Prefetch]]: ...
|
||||
|
||||
|
||||
class RelatedPopulator:
|
||||
db: str = ...
|
||||
cols_start: int = ...
|
||||
cols_end: int = ...
|
||||
init_list: List[str] = ...
|
||||
reorder_for_init: Optional[operator.itemgetter] = ...
|
||||
model_cls: Type[models.Model] = ...
|
||||
pk_idx: int = ...
|
||||
related_populators: List[models.query.RelatedPopulator] = ...
|
||||
local_setter: Callable = ...
|
||||
remote_setter: Callable = ...
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
klass_info: Dict[str, Any],
|
||||
select: List[Tuple[Expression, Tuple[str, List[int]], Optional[str]]],
|
||||
db: str,
|
||||
) -> None: ...
|
||||
|
||||
def populate(
|
||||
self,
|
||||
row: Union[
|
||||
List[Optional[Union[date, int, str]]],
|
||||
List[Union[date, Decimal, float, str]],
|
||||
Tuple[Union[int, str], str, int],
|
||||
],
|
||||
from_obj: Model,
|
||||
) -> None: ...
|
||||
|
||||
|
||||
def get_related_populators(
|
||||
klass_info: Dict[str, Any],
|
||||
select: List[Tuple[Expression, Tuple[str, List[bool]], Optional[str]]],
|
||||
db: str,
|
||||
) -> List[RelatedPopulator]: ...
|
||||
148
django-stubs-generated/db/models/query_utils.pyi
Normal file
148
django-stubs-generated/db/models/query_utils.pyi
Normal file
@@ -0,0 +1,148 @@
|
||||
from collections import OrderedDict, namedtuple
|
||||
from typing import Any, Dict, Iterator, List, Optional, Set, Tuple, Type, Union
|
||||
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.expressions import Expression
|
||||
from django.db.models.fields import Field
|
||||
from django.db.models.fields.mixins import FieldCacheMixin
|
||||
from django.db.models.functions.datetime import TimezoneMixin
|
||||
from django.db.models.lookups import (FieldGetDbPrepValueMixin,
|
||||
IntegerFieldFloatRounding, Lookup,
|
||||
Transform)
|
||||
from django.db.models.options import Options
|
||||
from django.db.models.sql.compiler import SQLCompiler
|
||||
from django.db.models.sql.query import Query
|
||||
from django.db.models.sql.where import WhereNode
|
||||
from django.utils import tree
|
||||
|
||||
PathInfo = namedtuple(
|
||||
"PathInfo",
|
||||
"from_opts to_opts target_fields join_field m2m direct filtered_relation",
|
||||
)
|
||||
|
||||
class InvalidQuery(Exception): ...
|
||||
|
||||
def subclasses(
|
||||
cls: Type[RegisterLookupMixin]
|
||||
) -> Iterator[Type[RegisterLookupMixin]]: ...
|
||||
|
||||
class QueryWrapper:
|
||||
contains_aggregate: bool = ...
|
||||
data: Tuple[str, List[Any]] = ...
|
||||
def __init__(self, sql: str, params: List[Any]) -> None: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler = ..., connection: DatabaseWrapper = ...
|
||||
) -> Tuple[str, List[Any]]: ...
|
||||
|
||||
class Q(tree.Node):
|
||||
children: Union[
|
||||
List[Dict[str, str]],
|
||||
List[Tuple[str, Any]],
|
||||
List[django.db.models.query_utils.Q],
|
||||
]
|
||||
connector: str
|
||||
negated: bool
|
||||
AND: str = ...
|
||||
OR: str = ...
|
||||
default: Any = ...
|
||||
conditional: bool = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def __or__(self, other: Any) -> Q: ...
|
||||
def __and__(self, other: Any) -> Q: ...
|
||||
def __invert__(self) -> Q: ...
|
||||
def resolve_expression(
|
||||
self,
|
||||
query: Query = ...,
|
||||
allow_joins: bool = ...,
|
||||
reuse: Optional[Set[str]] = ...,
|
||||
summarize: bool = ...,
|
||||
for_save: bool = ...,
|
||||
) -> WhereNode: ...
|
||||
def deconstruct(self) -> Tuple[str, Tuple, Dict[str, str]]: ...
|
||||
|
||||
class DeferredAttribute:
|
||||
field_name: str = ...
|
||||
def __init__(self, field_name: str) -> None: ...
|
||||
def __get__(
|
||||
self, instance: Optional[Model], cls: Type[Model] = ...
|
||||
) -> Any: ...
|
||||
|
||||
class RegisterLookupMixin:
|
||||
@classmethod
|
||||
def get_lookups(
|
||||
cls
|
||||
) -> Dict[str, Type[Union[TimezoneMixin, Lookup, Transform]]]: ...
|
||||
def get_lookup(
|
||||
self, lookup_name: str
|
||||
) -> Optional[Type[Union[FieldGetDbPrepValueMixin, Lookup]]]: ...
|
||||
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,
|
||||
]
|
||||
],
|
||||
]
|
||||
]
|
||||
) -> Dict[
|
||||
str,
|
||||
Type[Union[TimezoneMixin, FieldGetDbPrepValueMixin, Lookup, Transform]],
|
||||
]: ...
|
||||
@classmethod
|
||||
def register_lookup(
|
||||
cls,
|
||||
lookup: Type[Union[Lookup, Transform]],
|
||||
lookup_name: Optional[str] = ...,
|
||||
) -> Type[Union[Lookup, Transform]]: ...
|
||||
|
||||
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,
|
||||
]
|
||||
],
|
||||
load_fields: Optional[Set[str]],
|
||||
reverse: bool = ...,
|
||||
) -> bool: ...
|
||||
def refs_expression(
|
||||
lookup_parts: List[str], annotations: OrderedDict
|
||||
) -> Union[Tuple[bool, Tuple], Tuple[Expression, List[str]]]: ...
|
||||
def check_rel_lookup_compatibility(
|
||||
model: Type[Model], target_opts: Options, field: FieldCacheMixin
|
||||
) -> bool: ...
|
||||
|
||||
class FilteredRelation:
|
||||
relation_name: str = ...
|
||||
alias: Optional[str] = ...
|
||||
condition: django.db.models.query_utils.Q = ...
|
||||
path: List[str] = ...
|
||||
def __init__(self, relation_name: str, *, condition: Any = ...) -> None: ...
|
||||
def __eq__(self, other: FilteredRelation) -> bool: ...
|
||||
def clone(self) -> FilteredRelation: ...
|
||||
def resolve_expression(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Union[int, str]]]: ...
|
||||
34
django-stubs-generated/db/models/signals.pyi
Normal file
34
django-stubs-generated/db/models/signals.pyi
Normal file
@@ -0,0 +1,34 @@
|
||||
from typing import Any, Callable, Optional, Type, Union
|
||||
|
||||
from django.apps.registry import Apps
|
||||
from django.db.models.base import Model
|
||||
from django.dispatch import Signal
|
||||
|
||||
class_prepared: Any
|
||||
|
||||
class ModelSignal(Signal):
|
||||
def connect(
|
||||
self,
|
||||
receiver: Callable,
|
||||
sender: Optional[Union[Type[Model], str]] = ...,
|
||||
weak: bool = ...,
|
||||
dispatch_uid: None = ...,
|
||||
apps: Optional[Apps] = ...,
|
||||
) -> None: ...
|
||||
def disconnect(
|
||||
self,
|
||||
receiver: Callable = ...,
|
||||
sender: Optional[Union[Type[Model], str]] = ...,
|
||||
dispatch_uid: None = ...,
|
||||
apps: Optional[Apps] = ...,
|
||||
) -> Optional[bool]: ...
|
||||
|
||||
pre_init: Any
|
||||
post_init: Any
|
||||
pre_save: Any
|
||||
post_save: Any
|
||||
pre_delete: Any
|
||||
post_delete: Any
|
||||
m2m_changed: Any
|
||||
pre_migrate: Any
|
||||
post_migrate: Any
|
||||
0
django-stubs-generated/db/models/sql/__init__.pyi
Normal file
0
django-stubs-generated/db/models/sql/__init__.pyi
Normal file
254
django-stubs-generated/db/models/sql/compiler.pyi
Normal file
254
django-stubs-generated/db/models/sql/compiler.pyi
Normal file
@@ -0,0 +1,254 @@
|
||||
from datetime import date, datetime
|
||||
from decimal import Decimal
|
||||
from itertools import chain
|
||||
from typing import (Any, Callable, Dict, Iterator, List, Optional, Set, Tuple,
|
||||
Type, Union)
|
||||
from uuid import UUID
|
||||
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.backends.utils import CursorWrapper
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.expressions import (BaseExpression, Col, Expression,
|
||||
OrderBy, RawSQL, SQLiteNumericMixin)
|
||||
from django.db.models.fields import DateTimeCheckMixin, Field
|
||||
from django.db.models.functions.text import Lower
|
||||
from django.db.models.options import Options
|
||||
from django.db.models.sql.query import Query, RawQuery
|
||||
from django.utils.datastructures import ImmutableList
|
||||
|
||||
FORCE: Any
|
||||
|
||||
|
||||
class SQLCompiler:
|
||||
query: Any = ...
|
||||
connection: Any = ...
|
||||
using: Any = ...
|
||||
quote_cache: Any = ...
|
||||
select: Any = ...
|
||||
annotation_col_map: Any = ...
|
||||
klass_info: Any = ...
|
||||
ordering_parts: Any = ...
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
query: Union[Query, RawQuery],
|
||||
connection: DatabaseWrapper,
|
||||
using: Optional[str],
|
||||
) -> None: ...
|
||||
|
||||
col_count: Any = ...
|
||||
|
||||
def setup_query(self) -> None: ...
|
||||
|
||||
has_extra_select: Any = ...
|
||||
|
||||
def pre_sql_setup(
|
||||
self
|
||||
) -> Tuple[
|
||||
List[
|
||||
Tuple[OrderBy, Tuple[str, Union[List[Any], Tuple[str, str]]], None]
|
||||
],
|
||||
List[Tuple[OrderBy, Tuple[str, List[Union[int, str]], bool]]],
|
||||
List[Tuple[str, List[float]]],
|
||||
]: ...
|
||||
|
||||
def get_group_by(
|
||||
self,
|
||||
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 get_select(
|
||||
self
|
||||
) -> Tuple[
|
||||
List[
|
||||
Tuple[
|
||||
Union[Expression, SQLiteNumericMixin],
|
||||
Tuple[str, List[Union[int, str]]],
|
||||
Optional[str],
|
||||
]
|
||||
],
|
||||
Optional[
|
||||
Dict[str, Any]
|
||||
],
|
||||
Dict[str, int],
|
||||
]: ...
|
||||
|
||||
def get_order_by(
|
||||
self
|
||||
) -> List[Tuple[OrderBy, Tuple[str, List[Any], bool]]]: ...
|
||||
|
||||
def get_extra_select(
|
||||
self,
|
||||
order_by: List[Tuple[OrderBy, Tuple[str, List[Any], bool]]],
|
||||
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 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(
|
||||
self,
|
||||
start_alias: Optional[str] = ...,
|
||||
opts: Optional[Options] = ...,
|
||||
from_parent: Optional[Type[Model]] = ...,
|
||||
) -> List[Col]: ...
|
||||
|
||||
def get_distinct(self) -> Tuple[List[Any], List[Any]]: ...
|
||||
|
||||
def find_ordering_name(
|
||||
self,
|
||||
name: str,
|
||||
opts: Options,
|
||||
alias: Optional[str] = ...,
|
||||
default_order: str = ...,
|
||||
already_seen: Optional[
|
||||
Set[Tuple[Optional[Tuple[Tuple[str, str]]], Tuple[Tuple[str, str]]]]
|
||||
] = ...,
|
||||
) -> List[Tuple[OrderBy, bool]]: ...
|
||||
|
||||
def get_from_clause(self) -> Tuple[List[str], List[Union[int, str]]]: ...
|
||||
|
||||
def get_related_selections(
|
||||
self,
|
||||
select: List[Tuple[Expression, Optional[str]]],
|
||||
opts: Optional[Options] = ...,
|
||||
root_alias: Optional[str] = ...,
|
||||
cur_depth: int = ...,
|
||||
requested: Optional[
|
||||
Union[Dict[str, Dict[str, Dict[str, Dict[Any, Any]]]], bool]
|
||||
] = ...,
|
||||
restricted: Optional[bool] = ...,
|
||||
) -> List[Dict[str, Any]]: ...
|
||||
|
||||
def get_select_for_update_of_arguments(self): ...
|
||||
|
||||
def deferred_to_columns(self) -> Dict[Type[Model], Set[str]]: ...
|
||||
|
||||
def get_converters(
|
||||
self, expressions: Union[List[RawSQL], List[SQLiteNumericMixin]]
|
||||
) -> Dict[
|
||||
int, Tuple[List[Callable], Union[Expression, SQLiteNumericMixin]]
|
||||
]: ...
|
||||
|
||||
def apply_converters(
|
||||
self,
|
||||
rows: chain,
|
||||
converters: Dict[
|
||||
int, Tuple[List[Callable], Union[Expression, SQLiteNumericMixin]]
|
||||
],
|
||||
) -> Iterator[
|
||||
Union[
|
||||
List[Optional[Union[bytes, datetime, int, str]]],
|
||||
List[Optional[Union[date, Decimal, float, str]]],
|
||||
List[Optional[Union[datetime, float, str, UUID]]],
|
||||
]
|
||||
]: ...
|
||||
|
||||
def results_iter(
|
||||
self,
|
||||
results: Optional[
|
||||
Union[Iterator[Any], List[List[Tuple[Union[int, str]]]]]
|
||||
] = ...,
|
||||
tuple_expected: bool = ...,
|
||||
chunked_fetch: bool = ...,
|
||||
chunk_size: int = ...,
|
||||
) -> Union[Iterator[Any], chain, map]: ...
|
||||
|
||||
def has_results(self) -> bool: ...
|
||||
|
||||
def execute_sql(
|
||||
self,
|
||||
result_type: str = ...,
|
||||
chunked_fetch: bool = ...,
|
||||
chunk_size: int = ...,
|
||||
) -> Optional[Union[Iterator[Any], CursorWrapper]]: ...
|
||||
|
||||
def as_subquery_condition(
|
||||
self, alias: str, columns: List[str], compiler: SQLCompiler
|
||||
) -> Tuple[str, Tuple]: ...
|
||||
|
||||
def explain_query(self) -> Iterator[str]: ...
|
||||
|
||||
|
||||
class SQLInsertCompiler(SQLCompiler):
|
||||
return_id: bool = ...
|
||||
|
||||
def field_as_sql(
|
||||
self, field: Optional[Field], val: Optional[Union[Lower, float, str]]
|
||||
) -> Tuple[str, Union[List[int], List[str]]]: ...
|
||||
|
||||
def prepare_value(
|
||||
self, field: Field, value: Any
|
||||
) -> Optional[Union[Lower, float, str]]: ...
|
||||
|
||||
def pre_save_val(self, field: Field, obj: Model) -> Any: ...
|
||||
|
||||
def assemble_as_sql(
|
||||
self,
|
||||
fields: Union[
|
||||
List[None], List[DateTimeCheckMixin], List[Field], ImmutableList
|
||||
],
|
||||
value_rows: Union[
|
||||
List[List[Optional[Union[Lower, int]]]], List[List[Union[int, str]]]
|
||||
],
|
||||
) -> Tuple[Tuple[Tuple[str]], List[List[Optional[Union[int, str]]]]]: ...
|
||||
|
||||
def as_sql(self) -> List[Tuple[str, Tuple[Union[float, str]]]]: ...
|
||||
|
||||
def execute_sql(self, return_id: Optional[bool] = ...) -> Any: ...
|
||||
|
||||
|
||||
class SQLDeleteCompiler(SQLCompiler):
|
||||
def as_sql(self) -> Tuple[str, Tuple]: ...
|
||||
|
||||
|
||||
class SQLUpdateCompiler(SQLCompiler):
|
||||
def as_sql(self) -> Tuple[str, Tuple]: ...
|
||||
|
||||
def execute_sql(self, result_type: str) -> int: ...
|
||||
|
||||
def pre_sql_setup(self) -> None: ...
|
||||
|
||||
|
||||
class SQLAggregateCompiler(SQLCompiler):
|
||||
col_count: Any = ...
|
||||
|
||||
def as_sql(self) -> Tuple[str, Tuple]: ...
|
||||
|
||||
|
||||
def cursor_iter(
|
||||
cursor: CursorWrapper,
|
||||
sentinel: List[Any],
|
||||
col_count: Optional[int],
|
||||
itersize: int,
|
||||
) -> Iterator[List[Tuple[Union[date, int]]]]: ...
|
||||
66
django-stubs-generated/db/models/sql/datastructures.pyi
Normal file
66
django-stubs-generated/db/models/sql/datastructures.pyi
Normal file
@@ -0,0 +1,66 @@
|
||||
from collections import OrderedDict
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.models.fields.mixins import FieldCacheMixin
|
||||
from django.db.models.query_utils import FilteredRelation, PathInfo
|
||||
from django.db.models.sql.compiler import SQLCompiler
|
||||
|
||||
|
||||
class MultiJoin(Exception):
|
||||
level: int = ...
|
||||
names_with_path: List[
|
||||
Tuple[str, List[django.db.models.query_utils.PathInfo]]
|
||||
] = ...
|
||||
def __init__(
|
||||
self, names_pos: int, path_with_names: List[Tuple[str, List[PathInfo]]]
|
||||
) -> None: ...
|
||||
|
||||
class Empty: ...
|
||||
|
||||
class Join:
|
||||
table_name: str = ...
|
||||
parent_alias: str = ...
|
||||
table_alias: Optional[str] = ...
|
||||
join_type: str = ...
|
||||
join_cols: Tuple = ...
|
||||
join_field: django.db.models.fields.mixins.FieldCacheMixin = ...
|
||||
nullable: bool = ...
|
||||
filtered_relation: Optional[
|
||||
django.db.models.query_utils.FilteredRelation
|
||||
] = ...
|
||||
def __init__(
|
||||
self,
|
||||
table_name: str,
|
||||
parent_alias: str,
|
||||
table_alias: Optional[str],
|
||||
join_type: str,
|
||||
join_field: FieldCacheMixin,
|
||||
nullable: bool,
|
||||
filtered_relation: Optional[FilteredRelation] = ...,
|
||||
) -> None: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Union[int, str]]]: ...
|
||||
def relabeled_clone(
|
||||
self, change_map: Union[Dict[str, str], OrderedDict]
|
||||
) -> Join: ...
|
||||
def equals(
|
||||
self, other: Union[BaseTable, Join], with_filtered_relation: bool
|
||||
) -> bool: ...
|
||||
def __eq__(self, other: Union[BaseTable, Join]) -> bool: ...
|
||||
def demote(self) -> Join: ...
|
||||
def promote(self) -> Join: ...
|
||||
|
||||
class BaseTable:
|
||||
join_type: Any = ...
|
||||
parent_alias: Any = ...
|
||||
filtered_relation: Any = ...
|
||||
table_name: str = ...
|
||||
table_alias: Optional[str] = ...
|
||||
def __init__(self, table_name: str, alias: Optional[str]) -> None: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Any]]: ...
|
||||
def relabeled_clone(self, change_map: OrderedDict) -> BaseTable: ...
|
||||
def equals(self, other: Join, with_filtered_relation: bool) -> bool: ...
|
||||
384
django-stubs-generated/db/models/sql/query.pyi
Normal file
384
django-stubs-generated/db/models/sql/query.pyi
Normal file
@@ -0,0 +1,384 @@
|
||||
from collections import OrderedDict, namedtuple
|
||||
from datetime import datetime
|
||||
from decimal import Decimal
|
||||
from typing import (Any, Callable, Dict, Iterator, List, Optional, Set, Tuple,
|
||||
Type, Union)
|
||||
from uuid import UUID
|
||||
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.models.base import Model, ModelState
|
||||
from django.db.models.expressions import (Combinable, Expression,
|
||||
SQLiteNumericMixin)
|
||||
from django.db.models.fields import Field, TextField
|
||||
from django.db.models.fields.mixins import FieldCacheMixin
|
||||
from django.db.models.fields.related_lookups import MultiColSource
|
||||
from django.db.models.fields.reverse_related import (ForeignObjectRel,
|
||||
ManyToOneRel)
|
||||
from django.db.models.lookups import (FieldGetDbPrepValueMixin,
|
||||
IntegerLessThan, Lookup, Transform)
|
||||
from django.db.models.options import Options
|
||||
from django.db.models.query import QuerySet
|
||||
from django.db.models.query_utils import FilteredRelation, PathInfo, Q
|
||||
from django.db.models.sql.compiler import SQLCompiler
|
||||
from django.db.models.sql.datastructures import BaseTable, Join
|
||||
from django.db.models.sql.where import WhereNode
|
||||
|
||||
JoinInfo = namedtuple(
|
||||
"JoinInfo",
|
||||
["final_field", "targets", "opts", "joins", "path", "transform_function"],
|
||||
)
|
||||
|
||||
class RawQuery:
|
||||
high_mark: None
|
||||
low_mark: int
|
||||
params: Union[
|
||||
Dict[str, str],
|
||||
List[datetime.datetime],
|
||||
List[decimal.Decimal],
|
||||
List[str],
|
||||
Set[str],
|
||||
Tuple,
|
||||
] = ...
|
||||
sql: str = ...
|
||||
using: str = ...
|
||||
cursor: Optional[django.db.backends.utils.CursorWrapper] = ...
|
||||
extra_select: Dict[Any, Any] = ...
|
||||
annotation_select: Dict[Any, Any] = ...
|
||||
def __init__(
|
||||
self,
|
||||
sql: str,
|
||||
using: str,
|
||||
params: Optional[
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[datetime],
|
||||
List[Decimal],
|
||||
List[str],
|
||||
Set[str],
|
||||
Tuple[int],
|
||||
]
|
||||
] = ...,
|
||||
) -> None: ...
|
||||
def chain(self, using: str) -> RawQuery: ...
|
||||
def clone(self, using: str) -> RawQuery: ...
|
||||
def get_columns(self) -> List[str]: ...
|
||||
def __iter__(self): ...
|
||||
@property
|
||||
def params_type(self) -> Type[Union[dict, tuple]]: ...
|
||||
|
||||
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]]],
|
||||
]
|
||||
values: List[
|
||||
Tuple[
|
||||
django.db.models.fields.Field,
|
||||
Optional[Type[django.db.models.base.Model]],
|
||||
django.db.models.aggregates.Max,
|
||||
]
|
||||
]
|
||||
alias_prefix: str = ...
|
||||
subq_aliases: frozenset = ...
|
||||
compiler: str = ...
|
||||
model: Optional[Type[django.db.models.base.Model]] = ...
|
||||
alias_refcount: Dict[str, int] = ...
|
||||
alias_map: collections.OrderedDict = ...
|
||||
external_aliases: Set[str] = ...
|
||||
table_map: Dict[str, List[str]] = ...
|
||||
default_cols: bool = ...
|
||||
default_ordering: bool = ...
|
||||
standard_ordering: bool = ...
|
||||
used_aliases: Set[str] = ...
|
||||
filter_is_sticky: bool = ...
|
||||
subquery: bool = ...
|
||||
select: Union[List[django.db.models.expressions.Col], Tuple] = ...
|
||||
where: django.db.models.sql.where.WhereNode = ...
|
||||
where_class: Type[django.db.models.sql.where.WhereNode] = ...
|
||||
group_by: Optional[Union[Tuple, bool]] = ...
|
||||
order_by: Tuple = ...
|
||||
distinct: bool = ...
|
||||
distinct_fields: Tuple = ...
|
||||
select_for_update: bool = ...
|
||||
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,
|
||||
] = ...
|
||||
max_depth: int = ...
|
||||
values_select: Tuple = ...
|
||||
annotation_select_mask: Optional[Set[str]] = ...
|
||||
combinator: Optional[str] = ...
|
||||
combinator_all: bool = ...
|
||||
combined_queries: Tuple = ...
|
||||
extra_select_mask: Optional[Set[str]] = ...
|
||||
extra_tables: Tuple = ...
|
||||
extra_order_by: Union[List[str], Tuple] = ...
|
||||
deferred_loading: Tuple[Union[Set[str], frozenset], bool] = ...
|
||||
explain_query: bool = ...
|
||||
explain_format: Optional[str] = ...
|
||||
explain_options: Dict[str, int] = ...
|
||||
def __init__(
|
||||
self, model: Optional[Type[Model]], where: Type[WhereNode] = ...
|
||||
) -> None: ...
|
||||
@property
|
||||
def extra(self) -> OrderedDict: ...
|
||||
@property
|
||||
def annotations(self) -> OrderedDict: ...
|
||||
@property
|
||||
def has_select_fields(self) -> bool: ...
|
||||
def base_table(self) -> str: ...
|
||||
def sql_with_params(self) -> Tuple[str, Tuple]: ...
|
||||
def __deepcopy__(
|
||||
self,
|
||||
memo: Dict[
|
||||
int,
|
||||
Union[
|
||||
Dict[str, Union[ModelState, int, str]],
|
||||
List[Union[Dict[str, Union[bool, str]], ModelState]],
|
||||
Model,
|
||||
ModelState,
|
||||
],
|
||||
],
|
||||
) -> Query: ...
|
||||
def get_compiler(
|
||||
self,
|
||||
using: Optional[str] = ...,
|
||||
connection: Optional[DatabaseWrapper] = ...,
|
||||
) -> SQLCompiler: ...
|
||||
def get_meta(self) -> Options: ...
|
||||
def clone(self) -> Query: ...
|
||||
def chain(self, klass: Optional[Type[Query]] = ...) -> Query: ...
|
||||
def relabeled_clone(
|
||||
self, change_map: Union[Dict[Any, Any], OrderedDict]
|
||||
) -> Query: ...
|
||||
def rewrite_cols(
|
||||
self,
|
||||
annotation: Union[Expression, FieldGetDbPrepValueMixin, WhereNode],
|
||||
col_cnt: int,
|
||||
) -> Tuple[Union[Expression, IntegerLessThan], int]: ...
|
||||
def get_aggregation(
|
||||
self,
|
||||
using: str,
|
||||
added_aggregate_names: Union[Dict[str, SQLiteNumericMixin], List[str]],
|
||||
) -> Dict[str, Optional[Union[datetime, Decimal, float]]]: ...
|
||||
def get_count(self, using: str) -> int: ...
|
||||
def has_filters(self) -> WhereNode: ...
|
||||
def has_results(self, using: str) -> bool: ...
|
||||
def explain(
|
||||
self, using: str, format: Optional[str] = ..., **options: Any
|
||||
) -> str: ...
|
||||
def combine(self, rhs: Query, connector: str) -> None: ...
|
||||
def deferred_to_data(
|
||||
self, target: Dict[Any, Any], callback: Callable
|
||||
) -> None: ...
|
||||
def table_alias(
|
||||
self,
|
||||
table_name: str,
|
||||
create: bool = ...,
|
||||
filtered_relation: Optional[FilteredRelation] = ...,
|
||||
) -> Tuple[str, bool]: ...
|
||||
def ref_alias(self, alias: str) -> None: ...
|
||||
def unref_alias(self, alias: str, amount: int = ...) -> None: ...
|
||||
def promote_joins(self, aliases: Set[str]) -> None: ...
|
||||
def demote_joins(self, aliases: Set[str]) -> None: ...
|
||||
def reset_refcounts(self, to_counts: Dict[str, int]) -> None: ...
|
||||
def change_aliases(
|
||||
self, change_map: Union[Dict[Any, Any], OrderedDict]
|
||||
) -> None: ...
|
||||
def bump_prefix(self, outer_query: Query) -> None: ...
|
||||
def get_initial_alias(self) -> str: ...
|
||||
def count_active_tables(self) -> int: ...
|
||||
def join(
|
||||
self,
|
||||
join: Union[BaseTable, Join],
|
||||
reuse: Optional[Set[str]] = ...,
|
||||
reuse_with_filtered_relation: bool = ...,
|
||||
) -> str: ...
|
||||
def join_parent_model(
|
||||
self,
|
||||
opts: Options,
|
||||
model: Optional[Type[Model]],
|
||||
alias: str,
|
||||
seen: Dict[Optional[Type[Model]], str],
|
||||
) -> str: ...
|
||||
def add_annotation(
|
||||
self, annotation: Combinable, alias: str, is_summary: bool = ...
|
||||
) -> None: ...
|
||||
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 try_transform(self, lhs: Expression, name: str) -> Transform: ...
|
||||
def build_filter(
|
||||
self,
|
||||
filter_expr: Union[Dict[str, str], Tuple[str, Tuple[int, int]]],
|
||||
branch_negated: bool = ...,
|
||||
current_negated: bool = ...,
|
||||
can_reuse: Optional[Set[str]] = ...,
|
||||
allow_joins: bool = ...,
|
||||
split_subq: bool = ...,
|
||||
reuse_with_filtered_relation: bool = ...,
|
||||
) -> Tuple[WhereNode, List[Any]]: ...
|
||||
def add_filter(
|
||||
self, filter_clause: Tuple[str, Union[List[int], List[str]]]
|
||||
) -> None: ...
|
||||
def add_q(self, q_object: Q) -> None: ...
|
||||
def build_filtered_relation_q(
|
||||
self,
|
||||
q_object: Q,
|
||||
reuse: Set[str],
|
||||
branch_negated: bool = ...,
|
||||
current_negated: bool = ...,
|
||||
) -> WhereNode: ...
|
||||
def add_filtered_relation(
|
||||
self, filtered_relation: FilteredRelation, alias: str
|
||||
) -> None: ...
|
||||
def names_to_path(
|
||||
self,
|
||||
names: List[str],
|
||||
opts: Options,
|
||||
allow_many: bool = ...,
|
||||
fail_on_missing: bool = ...,
|
||||
) -> Tuple[
|
||||
List[PathInfo],
|
||||
Union[Field, reverse_related.ForeignObjectRel],
|
||||
Tuple[Field],
|
||||
List[str],
|
||||
]: ...
|
||||
def setup_joins(
|
||||
self,
|
||||
names: List[str],
|
||||
opts: Options,
|
||||
alias: str,
|
||||
can_reuse: Optional[Set[str]] = ...,
|
||||
allow_many: bool = ...,
|
||||
reuse_with_filtered_relation: bool = ...,
|
||||
) -> JoinInfo: ...
|
||||
def trim_joins(
|
||||
self, targets: Tuple[Field], joins: List[str], path: List[PathInfo]
|
||||
) -> Tuple[Tuple[Field], str, List[str]]: ...
|
||||
def resolve_ref(
|
||||
self,
|
||||
name: str,
|
||||
allow_joins: bool = ...,
|
||||
reuse: Optional[Set[str]] = ...,
|
||||
summarize: bool = ...,
|
||||
) -> Expression: ...
|
||||
def split_exclude(
|
||||
self,
|
||||
filter_expr: Tuple[str, Union[QuerySet, int]],
|
||||
can_reuse: Set[str],
|
||||
names_with_path: List[Tuple[str, List[PathInfo]]],
|
||||
) -> Tuple[WhereNode, Tuple]: ...
|
||||
def set_empty(self) -> None: ...
|
||||
def is_empty(self) -> bool: ...
|
||||
high_mark: Optional[int] = ...
|
||||
low_mark: int = ...
|
||||
def set_limits(
|
||||
self, low: Optional[int] = ..., high: Optional[int] = ...
|
||||
) -> None: ...
|
||||
def clear_limits(self) -> None: ...
|
||||
def has_limit_one(self) -> bool: ...
|
||||
def can_filter(self) -> bool: ...
|
||||
def clear_select_clause(self) -> None: ...
|
||||
def clear_select_fields(self) -> None: ...
|
||||
def set_select(self, cols: List[Expression]) -> None: ...
|
||||
def add_distinct_fields(self, *field_names: Any) -> None: ...
|
||||
def add_fields(
|
||||
self,
|
||||
field_names: Union[Iterator[Any], List[str]],
|
||||
allow_m2m: bool = ...,
|
||||
) -> None: ...
|
||||
def add_ordering(self, *ordering: Any) -> None: ...
|
||||
def clear_ordering(self, force_empty: bool) -> None: ...
|
||||
def set_group_by(self) -> None: ...
|
||||
def add_select_related(self, fields: Tuple[str]) -> None: ...
|
||||
def add_extra(
|
||||
self,
|
||||
select: Optional[Union[Dict[str, int], Dict[str, str], OrderedDict]],
|
||||
select_params: Optional[Union[List[int], List[str], Tuple[int]]],
|
||||
where: Optional[List[str]],
|
||||
params: Optional[List[str]],
|
||||
tables: Optional[List[str]],
|
||||
order_by: Optional[Union[List[str], Tuple[str]]],
|
||||
) -> None: ...
|
||||
def clear_deferred_loading(self) -> None: ...
|
||||
def add_deferred_loading(self, field_names: Tuple[str]) -> None: ...
|
||||
def add_immediate_loading(self, field_names: Tuple[str]) -> None: ...
|
||||
def get_loaded_field_names(self) -> Dict[Type[Model], Set[str]]: ...
|
||||
def get_loaded_field_names_cb(
|
||||
self,
|
||||
target: Dict[Type[Model], Set[str]],
|
||||
model: Type[Model],
|
||||
fields: Union[Set[Field], Set[reverse_related.ManyToOneRel]],
|
||||
) -> None: ...
|
||||
def set_annotation_mask(
|
||||
self, names: Optional[Union[List[str], Set[str], Tuple]]
|
||||
) -> None: ...
|
||||
def append_annotation_mask(self, names: List[str]) -> None: ...
|
||||
def set_extra_mask(self, names: Union[List[str], Tuple]) -> None: ...
|
||||
def set_values(self, fields: Union[List[str], Tuple]) -> None: ...
|
||||
@property
|
||||
def annotation_select(self) -> Union[Dict[Any, Any], OrderedDict]: ...
|
||||
@property
|
||||
def extra_select(self) -> Union[Dict[Any, Any], OrderedDict]: ...
|
||||
def trim_start(
|
||||
self, names_with_path: List[Tuple[str, List[PathInfo]]]
|
||||
) -> Tuple[str, bool]: ...
|
||||
def is_nullable(self, field: Field) -> bool: ...
|
||||
|
||||
class JoinPromoter:
|
||||
connector: str = ...
|
||||
negated: bool = ...
|
||||
effective_connector: str = ...
|
||||
num_children: int = ...
|
||||
votes: collections.Counter = ...
|
||||
def __init__(
|
||||
self, connector: str, num_children: int, negated: bool
|
||||
) -> None: ...
|
||||
def add_votes(
|
||||
self, votes: Union[Iterator[Any], List[Any], Set[str], Tuple]
|
||||
) -> None: ...
|
||||
def update_join_types(self, query: Query) -> Set[str]: ...
|
||||
227
django-stubs-generated/db/models/sql/subqueries.pyi
Normal file
227
django-stubs-generated/db/models/sql/subqueries.pyi
Normal file
@@ -0,0 +1,227 @@
|
||||
from typing import Any, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.expressions import Case
|
||||
from django.db.models.fields import DateTimeCheckMixin, Field
|
||||
from django.db.models.query import QuerySet
|
||||
from django.db.models.sql.query import Query
|
||||
from django.db.models.sql.where import WhereNode
|
||||
from django.utils.datastructures import ImmutableList
|
||||
|
||||
|
||||
class DeleteQuery(Query):
|
||||
alias_refcount: Dict[str, int]
|
||||
annotation_select_mask: None
|
||||
base_table: str
|
||||
combinator: None
|
||||
combinator_all: bool
|
||||
combined_queries: Tuple
|
||||
default_cols: bool
|
||||
default_ordering: bool
|
||||
deferred_loading: Tuple[frozenset, bool]
|
||||
distinct: bool
|
||||
distinct_fields: Tuple
|
||||
explain_format: None
|
||||
explain_options: Dict[Any, Any]
|
||||
explain_query: bool
|
||||
external_aliases: Set[Any]
|
||||
extra_order_by: Tuple
|
||||
extra_select_mask: None
|
||||
extra_tables: Tuple
|
||||
filter_is_sticky: bool
|
||||
group_by: None
|
||||
high_mark: None
|
||||
low_mark: int
|
||||
max_depth: int
|
||||
model: Type[django.db.models.base.Model]
|
||||
order_by: Tuple
|
||||
select: Tuple
|
||||
select_for_update: bool
|
||||
select_for_update_nowait: bool
|
||||
select_for_update_of: Tuple
|
||||
select_for_update_skip_locked: bool
|
||||
select_related: bool
|
||||
standard_ordering: bool
|
||||
subq_aliases: frozenset
|
||||
subquery: bool
|
||||
table_map: Dict[str, List[str]]
|
||||
used_aliases: Set[str]
|
||||
values_select: Tuple
|
||||
where_class: Type[django.db.models.sql.where.WhereNode]
|
||||
compiler: str = ...
|
||||
alias_map: Union[
|
||||
Dict[str, django.db.models.sql.datastructures.BaseTable],
|
||||
collections.OrderedDict,
|
||||
] = ...
|
||||
where: django.db.models.sql.where.WhereNode = ...
|
||||
def do_query(self, table: str, where: WhereNode, using: str) -> int: ...
|
||||
def delete_batch(
|
||||
self, pk_list: Union[List[int], List[str]], using: str
|
||||
) -> int: ...
|
||||
def delete_qs(self, query: QuerySet, using: str) -> int: ...
|
||||
|
||||
class UpdateQuery(Query):
|
||||
alias_map: collections.OrderedDict
|
||||
alias_refcount: Dict[str, int]
|
||||
annotation_select_mask: Optional[Set[Any]]
|
||||
base_table: str
|
||||
combinator: None
|
||||
combinator_all: bool
|
||||
combined_queries: Tuple
|
||||
default_cols: bool
|
||||
default_ordering: bool
|
||||
deferred_loading: Tuple[frozenset, bool]
|
||||
distinct: bool
|
||||
distinct_fields: Tuple
|
||||
explain_format: None
|
||||
explain_options: Dict[Any, Any]
|
||||
explain_query: bool
|
||||
external_aliases: Set[Any]
|
||||
extra_order_by: Tuple
|
||||
extra_select_mask: Optional[Set[Any]]
|
||||
extra_tables: Tuple
|
||||
filter_is_sticky: bool
|
||||
group_by: Optional[bool]
|
||||
high_mark: None
|
||||
low_mark: int
|
||||
max_depth: int
|
||||
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]]],
|
||||
]
|
||||
select: Tuple
|
||||
select_for_update: bool
|
||||
select_for_update_nowait: bool
|
||||
select_for_update_of: Tuple
|
||||
select_for_update_skip_locked: bool
|
||||
select_related: bool
|
||||
standard_ordering: bool
|
||||
subq_aliases: frozenset
|
||||
subquery: bool
|
||||
table_map: Dict[str, List[str]]
|
||||
used_aliases: Set[str]
|
||||
values: List[
|
||||
Tuple[
|
||||
django.db.models.fields.Field,
|
||||
Optional[Type[django.db.models.base.Model]],
|
||||
Union[django.db.models.expressions.Case, uuid.UUID],
|
||||
]
|
||||
]
|
||||
values_select: Tuple
|
||||
where_class: Type[django.db.models.sql.where.WhereNode]
|
||||
compiler: str = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def clone(self) -> UpdateQuery: ...
|
||||
where: django.db.models.sql.where.WhereNode = ...
|
||||
def update_batch(
|
||||
self, pk_list: List[int], values: Dict[str, Optional[int]], using: str
|
||||
) -> None: ...
|
||||
def add_update_values(self, values: Dict[str, Any]) -> None: ...
|
||||
def add_update_fields(
|
||||
self, values_seq: List[Tuple[Field, Optional[Type[Model]], Case]]
|
||||
) -> None: ...
|
||||
def add_related_update(
|
||||
self, model: Type[Model], field: Field, value: Union[int, str]
|
||||
) -> None: ...
|
||||
def get_related_updates(self) -> List[UpdateQuery]: ...
|
||||
|
||||
class InsertQuery(Query):
|
||||
alias_map: collections.OrderedDict
|
||||
alias_refcount: Dict[str, int]
|
||||
annotation_select_mask: None
|
||||
combinator: None
|
||||
combinator_all: bool
|
||||
combined_queries: Tuple
|
||||
default_cols: bool
|
||||
default_ordering: bool
|
||||
deferred_loading: Tuple[frozenset, bool]
|
||||
distinct: bool
|
||||
distinct_fields: Tuple
|
||||
explain_format: None
|
||||
explain_options: Dict[Any, Any]
|
||||
explain_query: bool
|
||||
external_aliases: Set[Any]
|
||||
extra_order_by: Tuple
|
||||
extra_select_mask: None
|
||||
extra_tables: Tuple
|
||||
filter_is_sticky: bool
|
||||
group_by: None
|
||||
high_mark: None
|
||||
low_mark: int
|
||||
max_depth: int
|
||||
model: Type[django.db.models.base.Model]
|
||||
order_by: Tuple
|
||||
select: Tuple
|
||||
select_for_update: bool
|
||||
select_for_update_nowait: bool
|
||||
select_for_update_of: Tuple
|
||||
select_for_update_skip_locked: bool
|
||||
select_related: bool
|
||||
standard_ordering: bool
|
||||
subquery: bool
|
||||
table_map: Dict[str, List[str]]
|
||||
used_aliases: Set[Any]
|
||||
values_select: Tuple
|
||||
where: django.db.models.sql.where.WhereNode
|
||||
where_class: Type[django.db.models.sql.where.WhereNode]
|
||||
compiler: str = ...
|
||||
fields: Union[
|
||||
List[django.db.models.fields.DateTimeCheckMixin],
|
||||
List[django.db.models.fields.Field],
|
||||
django.utils.datastructures.ImmutableList,
|
||||
] = ...
|
||||
objs: List[django.db.models.base.Model] = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
raw: bool = ...
|
||||
def insert_values(
|
||||
self,
|
||||
fields: Union[List[DateTimeCheckMixin], List[Field], ImmutableList],
|
||||
objs: List[Model],
|
||||
raw: bool = ...,
|
||||
) -> None: ...
|
||||
|
||||
class AggregateQuery(Query):
|
||||
alias_map: collections.OrderedDict
|
||||
alias_refcount: Dict[Any, Any]
|
||||
annotation_select_mask: None
|
||||
combinator: None
|
||||
combinator_all: bool
|
||||
combined_queries: Tuple
|
||||
default_cols: bool
|
||||
default_ordering: bool
|
||||
deferred_loading: Tuple[frozenset, bool]
|
||||
distinct: bool
|
||||
distinct_fields: Tuple
|
||||
explain_format: None
|
||||
explain_options: Dict[Any, Any]
|
||||
explain_query: bool
|
||||
external_aliases: Set[Any]
|
||||
extra_order_by: Tuple
|
||||
extra_select_mask: None
|
||||
extra_tables: Tuple
|
||||
filter_is_sticky: bool
|
||||
group_by: None
|
||||
high_mark: None
|
||||
low_mark: int
|
||||
max_depth: int
|
||||
model: Type[django.db.models.base.Model]
|
||||
order_by: Tuple
|
||||
select: Tuple
|
||||
select_for_update: bool
|
||||
select_for_update_nowait: bool
|
||||
select_for_update_of: Tuple
|
||||
select_for_update_skip_locked: bool
|
||||
select_related: bool
|
||||
standard_ordering: bool
|
||||
sub_params: Tuple
|
||||
subquery: Union[bool, str]
|
||||
table_map: Dict[Any, Any]
|
||||
used_aliases: Set[Any]
|
||||
values_select: Tuple
|
||||
where: django.db.models.sql.where.WhereNode
|
||||
where_class: Type[django.db.models.sql.where.WhereNode]
|
||||
compiler: str = ...
|
||||
def add_subquery(self, query: Query, using: str) -> None: ...
|
||||
89
django-stubs-generated/db/models/sql/where.pyi
Normal file
89
django-stubs-generated/db/models/sql/where.pyi
Normal file
@@ -0,0 +1,89 @@
|
||||
from collections import OrderedDict
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
from django.db import DefaultConnectionProxy
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.models.expressions import Expression
|
||||
from django.db.models.lookups import FieldGetDbPrepValueMixin
|
||||
from django.db.models.sql.compiler import SQLCompiler
|
||||
from django.db.models.sql.query import Query
|
||||
from django.utils import tree
|
||||
|
||||
AND: str
|
||||
OR: str
|
||||
|
||||
class WhereNode(tree.Node):
|
||||
connector: str
|
||||
contains_aggregate: bool
|
||||
contains_over_clause: bool
|
||||
negated: bool
|
||||
default: Any = ...
|
||||
resolved: bool = ...
|
||||
conditional: bool = ...
|
||||
def split_having(
|
||||
self, negated: bool = ...
|
||||
) -> Tuple[Optional[WhereNode], Optional[WhereNode]]: ...
|
||||
def as_sql(
|
||||
self,
|
||||
compiler: SQLCompiler,
|
||||
connection: Union[DefaultConnectionProxy, DatabaseWrapper],
|
||||
) -> Tuple[str, List[Union[int, str]]]: ...
|
||||
def get_group_by_cols(self) -> List[Expression]: ...
|
||||
def get_source_expressions(self) -> List[FieldGetDbPrepValueMixin]: ...
|
||||
children: List[
|
||||
Union[
|
||||
django.db.models.lookups.BuiltinLookup,
|
||||
django.db.models.sql.where.WhereNode,
|
||||
]
|
||||
] = ...
|
||||
def set_source_expressions(
|
||||
self, children: List[FieldGetDbPrepValueMixin]
|
||||
) -> None: ...
|
||||
def relabel_aliases(
|
||||
self, change_map: Union[Dict[Optional[str], str], OrderedDict]
|
||||
) -> None: ...
|
||||
def clone(self) -> WhereNode: ...
|
||||
def relabeled_clone(
|
||||
self, change_map: Union[Dict[Optional[str], str], OrderedDict]
|
||||
) -> WhereNode: ...
|
||||
def contains_aggregate(self) -> bool: ...
|
||||
def contains_over_clause(self) -> bool: ...
|
||||
@property
|
||||
def is_summary(self): ...
|
||||
def resolve_expression(self, *args: Any, **kwargs: Any) -> WhereNode: ...
|
||||
|
||||
class NothingNode:
|
||||
contains_aggregate: bool = ...
|
||||
def as_sql(
|
||||
self,
|
||||
compiler: SQLCompiler = ...,
|
||||
connection: Union[DefaultConnectionProxy, DatabaseWrapper] = ...,
|
||||
) -> Any: ...
|
||||
|
||||
class ExtraWhere:
|
||||
contains_aggregate: bool = ...
|
||||
sqls: List[str] = ...
|
||||
params: Optional[Union[List[int], List[str]]] = ...
|
||||
def __init__(
|
||||
self, sqls: List[str], params: Optional[Union[List[int], List[str]]]
|
||||
) -> None: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler = ..., connection: DatabaseWrapper = ...
|
||||
) -> Tuple[str, Union[List[int], List[str]]]: ...
|
||||
|
||||
class SubqueryConstraint:
|
||||
contains_aggregate: bool = ...
|
||||
alias: str = ...
|
||||
columns: List[str] = ...
|
||||
targets: List[str] = ...
|
||||
query_object: django.db.models.sql.query.Query = ...
|
||||
def __init__(
|
||||
self,
|
||||
alias: str,
|
||||
columns: List[str],
|
||||
targets: List[str],
|
||||
query_object: Query,
|
||||
) -> None: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, Tuple]: ...
|
||||
6
django-stubs-generated/db/models/utils.pyi
Normal file
6
django-stubs-generated/db/models/utils.pyi
Normal file
@@ -0,0 +1,6 @@
|
||||
from typing import Any, Optional, Tuple, Type, Union
|
||||
|
||||
from django.db.models.base import Model
|
||||
|
||||
|
||||
def make_model_tuple(model: Union[Type[Model], str]) -> Tuple[str, str]: ...
|
||||
35
django-stubs-generated/db/transaction.pyi
Normal file
35
django-stubs-generated/db/transaction.pyi
Normal file
@@ -0,0 +1,35 @@
|
||||
from contextlib import ContextDecorator
|
||||
from typing import Any, Callable, Optional, Union, ContextManager
|
||||
|
||||
from django.db import ProgrammingError
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
|
||||
|
||||
class TransactionManagementError(ProgrammingError): ...
|
||||
|
||||
def get_connection(using: Optional[str] = ...) -> DatabaseWrapper: ...
|
||||
def get_autocommit(using: Optional[str] = ...) -> bool: ...
|
||||
def set_autocommit(autocommit: bool, using: None = ...) -> Any: ...
|
||||
def commit(using: None = ...) -> Any: ...
|
||||
def rollback(using: None = ...) -> Any: ...
|
||||
def savepoint(using: None = ...) -> str: ...
|
||||
def savepoint_rollback(sid: str, using: None = ...) -> None: ...
|
||||
def savepoint_commit(sid: Any, using: Optional[Any] = ...) -> None: ...
|
||||
def clean_savepoints(using: Optional[Any] = ...) -> None: ...
|
||||
def get_rollback(using: None = ...) -> bool: ...
|
||||
def set_rollback(rollback: bool, using: Optional[str] = ...) -> None: ...
|
||||
def on_commit(func: Callable, using: None = ...) -> None: ...
|
||||
|
||||
class Atomic(ContextDecorator):
|
||||
using: Optional[str] = ...
|
||||
savepoint: bool = ...
|
||||
def __init__(self, using: Optional[str], savepoint: bool) -> None: ...
|
||||
def __enter__(self) -> None: ...
|
||||
def __exit__(
|
||||
self, exc_type: None, exc_value: None, traceback: None
|
||||
) -> None: ...
|
||||
|
||||
def atomic(
|
||||
using: Optional[Union[Callable, str]] = ..., savepoint: bool = ...
|
||||
) -> ContextManager[Atomic]: ...
|
||||
def non_atomic_requests(using: Callable = ...) -> Callable: ...
|
||||
73
django-stubs-generated/db/utils.pyi
Normal file
73
django-stubs-generated/db/utils.pyi
Normal file
@@ -0,0 +1,73 @@
|
||||
from typing import Any, Callable, Dict, List, Optional, Type, Union
|
||||
from unittest.mock import Mock
|
||||
|
||||
from django.apps.config import AppConfig
|
||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.models.base import Model
|
||||
|
||||
DEFAULT_DB_ALIAS: str
|
||||
DJANGO_VERSION_PICKLE_KEY: str
|
||||
|
||||
class Error(Exception): ...
|
||||
class InterfaceError(Error): ...
|
||||
class DatabaseError(Error): ...
|
||||
class DataError(DatabaseError): ...
|
||||
class OperationalError(DatabaseError): ...
|
||||
class IntegrityError(DatabaseError): ...
|
||||
class InternalError(DatabaseError): ...
|
||||
class ProgrammingError(DatabaseError): ...
|
||||
class NotSupportedError(DatabaseError): ...
|
||||
|
||||
class DatabaseErrorWrapper:
|
||||
wrapper: django.db.backends.sqlite3.base.DatabaseWrapper = ...
|
||||
def __init__(self, wrapper: DatabaseWrapper) -> None: ...
|
||||
def __enter__(self) -> None: ...
|
||||
def __exit__(
|
||||
self, exc_type: None, exc_value: None, traceback: None
|
||||
) -> None: ...
|
||||
def __call__(self, func: Callable) -> Callable: ...
|
||||
|
||||
def load_backend(backend_name: str) -> Any: ...
|
||||
|
||||
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 ensure_defaults(self, alias: str) -> None: ...
|
||||
def prepare_test_settings(self, alias: str) -> None: ...
|
||||
def __getitem__(self, alias: str) -> BaseDatabaseWrapper: ...
|
||||
def __setitem__(self, key: Any, value: Any) -> None: ...
|
||||
def __delitem__(self, key: Any) -> None: ...
|
||||
def __iter__(self): ...
|
||||
def all(self) -> List[DatabaseWrapper]: ...
|
||||
def close_all(self) -> None: ...
|
||||
|
||||
class ConnectionRouter:
|
||||
routers: List[Any]
|
||||
def __init__(self, routers: None = ...) -> None: ...
|
||||
def routers(self) -> List[Mock]: ...
|
||||
db_for_read: Any = ...
|
||||
db_for_write: Any = ...
|
||||
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]]: ...
|
||||
Reference in New Issue
Block a user