mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-01-21 02:22:08 +08:00
finish moving generated stubs
This commit is contained in:
@@ -15,7 +15,7 @@ jobs:
|
||||
- name: "Lint with black"
|
||||
python: 3.7
|
||||
script: |
|
||||
black --check --line-length=120 django-stubs/ django-stubs-generated/
|
||||
black --check --line-length=120 django-stubs/
|
||||
|
||||
before_install: |
|
||||
# Upgrade pip, setuptools, and wheel
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
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
|
||||
@@ -1,96 +0,0 @@
|
||||
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: ...
|
||||
@@ -1,9 +0,0 @@
|
||||
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: ...
|
||||
@@ -1,24 +0,0 @@
|
||||
from typing import Any, Dict, Optional, Tuple, Union
|
||||
|
||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||
|
||||
TEST_DATABASE_PREFIX: str
|
||||
|
||||
class BaseDatabaseCreation:
|
||||
connection: Any = ...
|
||||
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]: ...
|
||||
@@ -1,100 +0,0 @@
|
||||
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): ...
|
||||
@@ -1,27 +0,0 @@
|
||||
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: ...
|
||||
@@ -1,104 +0,0 @@
|
||||
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: Any = ...
|
||||
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: ...
|
||||
@@ -1,78 +0,0 @@
|
||||
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: ...
|
||||
@@ -1,10 +0,0 @@
|
||||
from typing import Any, List, Optional
|
||||
|
||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||
from django.db.models.fields import Field
|
||||
|
||||
class BaseDatabaseValidation:
|
||||
connection: Any = ...
|
||||
def __init__(self, connection: BaseDatabaseWrapper) -> None: ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def check_field(self, field: Field, **kwargs: Any) -> List[Any]: ...
|
||||
@@ -1,66 +0,0 @@
|
||||
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: ...
|
||||
@@ -1,75 +0,0 @@
|
||||
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: ...
|
||||
@@ -1,10 +0,0 @@
|
||||
from typing import Any, Optional, Tuple
|
||||
|
||||
from django.db.backends.base.creation import BaseDatabaseCreation
|
||||
|
||||
class DatabaseCreation(BaseDatabaseCreation):
|
||||
connection: Any
|
||||
@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]: ...
|
||||
@@ -1,30 +0,0 @@
|
||||
from typing import Optional
|
||||
|
||||
from django.db.backends.base.features import BaseDatabaseFeatures
|
||||
|
||||
class DatabaseFeatures(BaseDatabaseFeatures):
|
||||
connection: Any
|
||||
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: ...
|
||||
@@ -1,28 +0,0 @@
|
||||
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: Any
|
||||
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]]]: ...
|
||||
@@ -1,75 +0,0 @@
|
||||
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: Any
|
||||
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]]: ...
|
||||
@@ -1,41 +0,0 @@
|
||||
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: Any = ...
|
||||
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: Any
|
||||
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: ...
|
||||
@@ -1,84 +0,0 @@
|
||||
# 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
|
||||
|
||||
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,
|
||||
)
|
||||
@@ -1,82 +0,0 @@
|
||||
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: ...
|
||||
@@ -1,85 +0,0 @@
|
||||
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): ...
|
||||
@@ -1,52 +0,0 @@
|
||||
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]]: ...
|
||||
@@ -1,404 +0,0 @@
|
||||
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): ...
|
||||
@@ -1,445 +0,0 @@
|
||||
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]: ...
|
||||
@@ -1,12 +0,0 @@
|
||||
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: ...
|
||||
@@ -1,232 +0,0 @@
|
||||
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]: ...
|
||||
@@ -1,65 +0,0 @@
|
||||
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): ...
|
||||
@@ -1,252 +0,0 @@
|
||||
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 = ...
|
||||
@@ -1,22 +0,0 @@
|
||||
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: ...
|
||||
@@ -1,278 +0,0 @@
|
||||
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: ...
|
||||
@@ -1,90 +0,0 @@
|
||||
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: ...
|
||||
@@ -1,263 +0,0 @@
|
||||
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,
|
||||
Sequence,
|
||||
)
|
||||
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: Sequence[Model], batch_size: Optional[int] = ...) -> List[_T]: ...
|
||||
def get_or_create(self, defaults: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> Tuple[_T, bool]: ...
|
||||
def update_or_create(self, defaults: Optional[Dict[str, Any]] = ..., **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]: ...
|
||||
@@ -1,97 +0,0 @@
|
||||
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]]]: ...
|
||||
@@ -1,145 +0,0 @@
|
||||
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]]]]: ...
|
||||
@@ -1,51 +0,0 @@
|
||||
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: ...
|
||||
@@ -1,266 +0,0 @@
|
||||
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]: ...
|
||||
@@ -1,211 +0,0 @@
|
||||
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: ...
|
||||
@@ -1,58 +0,0 @@
|
||||
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: Any) -> 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: Any = ...) -> 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]: ...
|
||||
@@ -1,30 +0,0 @@
|
||||
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: ...
|
||||
@@ -1,59 +0,0 @@
|
||||
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: Any = ...
|
||||
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]]: ...
|
||||
@@ -91,7 +91,7 @@ class BaseModelAdmin:
|
||||
|
||||
class ModelAdmin(BaseModelAdmin):
|
||||
formfield_overrides: Dict[
|
||||
Type[Union[django.db.models.fields.DateTimeCheckMixin, django.db.models.fields.Field]],
|
||||
Type[Union[django.db.models.fields.DateTimeCheckMixin, Field]],
|
||||
Dict[str, Type[Union[django.forms.fields.SplitDateTimeField, django.forms.widgets.Widget]]],
|
||||
]
|
||||
list_display: Any = ...
|
||||
@@ -122,7 +122,7 @@ class ModelAdmin(BaseModelAdmin):
|
||||
actions_on_bottom: bool = ...
|
||||
actions_selection_counter: bool = ...
|
||||
checks_class: Any = ...
|
||||
model: Type[django.db.models.base.Model] = ...
|
||||
model: Type[Model] = ...
|
||||
opts: django.db.models.options.Options = ...
|
||||
admin_site: django.contrib.admin.sites.AdminSite = ...
|
||||
def __init__(self, model: Type[Model], admin_site: Optional[AdminSite]) -> None: ...
|
||||
|
||||
@@ -17,7 +17,7 @@ ERROR_FLAG: str
|
||||
IGNORED_PARAMS: Any
|
||||
|
||||
class ChangeList:
|
||||
model: Type[django.db.models.base.Model] = ...
|
||||
model: Type[Model] = ...
|
||||
opts: django.db.models.options.Options = ...
|
||||
lookup_opts: django.db.models.options.Options = ...
|
||||
root_queryset: django.db.models.query.QuerySet = ...
|
||||
|
||||
@@ -28,7 +28,7 @@ class GroupAdmin(admin.ModelAdmin):
|
||||
class UserAdmin(admin.ModelAdmin):
|
||||
admin_site: django.contrib.admin.sites.AdminSite
|
||||
formfield_overrides: Dict[
|
||||
Type[Union[django.db.models.fields.DateTimeCheckMixin, django.db.models.fields.Field]],
|
||||
Type[Union[django.db.models.fields.DateTimeCheckMixin, Field]],
|
||||
Dict[str, Type[Union[django.forms.fields.SplitDateTimeField, django.forms.widgets.Widget]]],
|
||||
]
|
||||
model: Type[django.contrib.auth.models.User]
|
||||
|
||||
@@ -49,7 +49,7 @@ class GenericForeignKey(FieldCacheMixin):
|
||||
class GenericRel(ForeignObjectRel):
|
||||
field: django.contrib.contenttypes.fields.GenericRelation
|
||||
limit_choices_to: Dict[Any, Any]
|
||||
model: Type[django.db.models.base.Model]
|
||||
model: Type[Model]
|
||||
multiple: bool
|
||||
on_delete: Callable
|
||||
parent_link: bool
|
||||
|
||||
@@ -29,24 +29,19 @@ class CommandParser(ArgumentParser):
|
||||
def handle_default_options(options: Namespace) -> None: ...
|
||||
def no_translations(handle_func: Callable) -> Callable: ...
|
||||
|
||||
class DjangoHelpFormatter(HelpFormatter):
|
||||
show_last: Any = ...
|
||||
def add_usage(self, usage: None, actions: List[Any], *args: Any, **kwargs: Any) -> None: ...
|
||||
def add_arguments(self, actions: List[Any]) -> None: ...
|
||||
class DjangoHelpFormatter(HelpFormatter): ...
|
||||
|
||||
class OutputWrapper(TextIOBase):
|
||||
@property
|
||||
def style_func(self): ...
|
||||
@style_func.setter
|
||||
def style_func(self, style_func: Any): ...
|
||||
style_func: Any = ...
|
||||
ending: str = ...
|
||||
def __init__(
|
||||
self, out: Union[StringIO, TextIOWrapper], style_func: Optional[Callable] = ..., ending: str = ...
|
||||
) -> None: ...
|
||||
def __getattr__(self, name: str) -> Callable: ...
|
||||
def isatty(self) -> bool: ...
|
||||
def write(self, msg: str, style_func: Optional[Callable] = ..., ending: Optional[str] = ...) -> None: ...
|
||||
|
||||
class BaseCommand:
|
||||
help: str = ...
|
||||
@@ -80,13 +75,9 @@ class BaseCommand:
|
||||
|
||||
class AppCommand(BaseCommand):
|
||||
missing_args_message: str = ...
|
||||
def add_arguments(self, parser: Any) -> None: ...
|
||||
def handle(self, *app_labels: Any, **options: Any): ...
|
||||
def handle_app_config(self, app_config: Any, **options: Any) -> None: ...
|
||||
|
||||
class LabelCommand(BaseCommand):
|
||||
label: str = ...
|
||||
missing_args_message: Any = ...
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
def handle(self, *labels: Any, **options: Any) -> str: ...
|
||||
def handle_label(self, label: Any, **options: Any) -> None: ...
|
||||
|
||||
13
django-stubs/db/backends/sqlite3/base.pyi
Normal file
13
django-stubs/db/backends/sqlite3/base.pyi
Normal file
@@ -0,0 +1,13 @@
|
||||
from sqlite3 import dbapi2 as Database
|
||||
from sqlite3 import dbapi2 as Database
|
||||
from typing import Any, Callable, Iterator
|
||||
|
||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||
|
||||
def decoder(conv_func: Callable) -> Callable: ...
|
||||
|
||||
class DatabaseWrapper(BaseDatabaseWrapper): ...
|
||||
|
||||
FORMAT_QMARK_REGEX: Any
|
||||
|
||||
class SQLiteCursorWrapper(Database.Cursor): ...
|
||||
3
django-stubs/db/backends/sqlite3/creation.pyi
Normal file
3
django-stubs/db/backends/sqlite3/creation.pyi
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.db.backends.base.creation import BaseDatabaseCreation
|
||||
|
||||
class DatabaseCreation(BaseDatabaseCreation): ...
|
||||
3
django-stubs/db/backends/sqlite3/features.pyi
Normal file
3
django-stubs/db/backends/sqlite3/features.pyi
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.db.backends.base.features import BaseDatabaseFeatures
|
||||
|
||||
class DatabaseFeatures(BaseDatabaseFeatures): ...
|
||||
13
django-stubs/db/backends/sqlite3/introspection.pyi
Normal file
13
django-stubs/db/backends/sqlite3/introspection.pyi
Normal file
@@ -0,0 +1,13 @@
|
||||
from typing import Any, Dict, Optional, Tuple, Union
|
||||
|
||||
from django.db.backends.base.introspection import BaseDatabaseIntrospection
|
||||
|
||||
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): ...
|
||||
3
django-stubs/db/backends/sqlite3/operations.pyi
Normal file
3
django-stubs/db/backends/sqlite3/operations.pyi
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.db.backends.base.operations import BaseDatabaseOperations
|
||||
|
||||
class DatabaseOperations(BaseDatabaseOperations): ...
|
||||
@@ -1,6 +1,6 @@
|
||||
from datetime import date, datetime, time
|
||||
from decimal import Decimal
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
|
||||
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
|
||||
|
||||
logger: Any
|
||||
|
||||
@@ -9,7 +9,7 @@ class CursorWrapper:
|
||||
db: Any = ...
|
||||
def __init__(self, cursor: Any, db: Any) -> None: ...
|
||||
WRAP_ERROR_ATTRS: Any = ...
|
||||
def __getattr__(self, attr: str) -> Union[Callable, Tuple[Tuple[str, None, None, None, None, None, None]], int]: ...
|
||||
def __getattr__(self, attr: str) -> Any: ...
|
||||
def __iter__(self) -> None: ...
|
||||
def __enter__(self) -> CursorWrapper: ...
|
||||
def __exit__(self, type: None, value: None, traceback: None) -> None: ...
|
||||
@@ -24,8 +24,6 @@ class CursorWrapper:
|
||||
class CursorDebugWrapper(CursorWrapper):
|
||||
cursor: Any
|
||||
db: Any
|
||||
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]: ...
|
||||
|
||||
@@ -32,7 +32,7 @@ from .query import QuerySet as QuerySet, RawQuerySet as RawQuerySet
|
||||
|
||||
from .query_utils import Q as Q, FilteredRelation as FilteredRelation
|
||||
|
||||
from .lookups import Lookup as Lookup
|
||||
from .lookups import Lookup as Lookup, Transform as Transform
|
||||
|
||||
from .expressions import (
|
||||
F as F,
|
||||
@@ -45,6 +45,9 @@ from .expressions import (
|
||||
When as When,
|
||||
RawSQL as RawSQL,
|
||||
Value as Value,
|
||||
Func as Func,
|
||||
)
|
||||
|
||||
from .manager import BaseManager as BaseManager, Manager as Manager
|
||||
|
||||
from . import lookups as lookups
|
||||
|
||||
@@ -10,42 +10,14 @@ class Aggregate(Func):
|
||||
filter: Any = ...
|
||||
def __init__(self, *args: Any, filter: Optional[Any] = ..., **kwargs: Any) -> None: ...
|
||||
|
||||
class Avg(Aggregate):
|
||||
filter: None
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
class Avg(Aggregate): ...
|
||||
|
||||
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: ...
|
||||
|
||||
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 = ...
|
||||
|
||||
class Sum(Aggregate):
|
||||
filter: None
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
|
||||
class Variance(Aggregate):
|
||||
filter: None
|
||||
name: str = ...
|
||||
output_field: Any = ...
|
||||
function: str = ...
|
||||
class Max(Aggregate): ...
|
||||
class Min(Aggregate): ...
|
||||
class StdDev(Aggregate): ...
|
||||
class Sum(Aggregate): ...
|
||||
class Variance(Aggregate): ...
|
||||
|
||||
@@ -9,7 +9,7 @@ from django.db.models.fields import Field
|
||||
from django.forms.fields import FileField, ImageField
|
||||
|
||||
class FieldFile(File):
|
||||
instance: django.db.models.base.Model = ...
|
||||
instance: 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: ...
|
||||
@@ -66,7 +66,7 @@ class ImageFileDescriptor(FileDescriptor):
|
||||
|
||||
class ImageFieldFile(ImageFile, FieldFile):
|
||||
field: django.db.models.fields.files.ImageField
|
||||
instance: django.db.models.base.Model
|
||||
instance: Model
|
||||
name: Optional[str]
|
||||
storage: django.core.files.storage.DefaultStorage
|
||||
def delete(self, save: bool = ...) -> None: ...
|
||||
@@ -3,8 +3,9 @@ from typing import Any, Callable, List, Optional, Tuple, Type, Union, Generic, T
|
||||
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 import Field
|
||||
from django.db.models.fields.mixins import FieldCacheMixin
|
||||
from django.db.models.fields.related import ForeignObject, RelatedField, OneToOneField
|
||||
from django.db.models.fields.related import RelatedField, OneToOneField
|
||||
from django.db.models.fields.reverse_related import ManyToManyRel, OneToOneRel
|
||||
from django.db.models.query import QuerySet
|
||||
|
||||
@@ -12,8 +13,8 @@ _T = TypeVar("_T")
|
||||
|
||||
class ForwardManyToOneDescriptor:
|
||||
RelatedObjectDoesNotExist: Type[ObjectDoesNotExist]
|
||||
field: ForeignObject = ...
|
||||
def __init__(self, field_with_rel: ForeignObject) -> None: ...
|
||||
field: Field = ...
|
||||
def __init__(self, field_with_rel: Field) -> None: ...
|
||||
def is_cached(self, instance: Model) -> bool: ...
|
||||
def get_queryset(self, **hints: Any) -> QuerySet: ...
|
||||
def get_prefetch_queryset(
|
||||
48
django-stubs/db/models/fields/related_lookups.pyi
Normal file
48
django-stubs/db/models/fields/related_lookups.pyi
Normal file
@@ -0,0 +1,48 @@
|
||||
from collections import OrderedDict
|
||||
from typing import Any, List, Tuple, Type, Iterable
|
||||
|
||||
from django.db.models.expressions import Expression
|
||||
from django.db.models.lookups import (
|
||||
BuiltinLookup,
|
||||
Exact,
|
||||
GreaterThan,
|
||||
GreaterThanOrEqual,
|
||||
In,
|
||||
IsNull,
|
||||
LessThan,
|
||||
LessThanOrEqual,
|
||||
)
|
||||
|
||||
from django.db.models.fields import Field
|
||||
|
||||
class MultiColSource:
|
||||
alias: str
|
||||
field: Field
|
||||
sources: Tuple[Field, Field]
|
||||
targets: Tuple[Field, Field]
|
||||
contains_aggregate: bool = ...
|
||||
output_field: Field = ...
|
||||
def __init__(
|
||||
self, alias: str, targets: Tuple[Field, Field], sources: Tuple[Field, Field], field: Field
|
||||
) -> None: ...
|
||||
def relabeled_clone(self, relabels: OrderedDict) -> MultiColSource: ...
|
||||
def get_lookup(self, lookup: str) -> Type[BuiltinLookup]: ...
|
||||
|
||||
def get_normalized_value(value: Any, lhs: Expression) -> Tuple[None]: ...
|
||||
|
||||
class RelatedIn(In):
|
||||
bilateral_transforms: List[Any]
|
||||
lhs: Expression
|
||||
rhs: Any = ...
|
||||
def get_prep_lookup(self) -> Iterable[Any]: ...
|
||||
|
||||
class RelatedLookupMixin:
|
||||
rhs: Any = ...
|
||||
def get_prep_lookup(self) -> Any: ...
|
||||
|
||||
class RelatedExact(RelatedLookupMixin, Exact): ...
|
||||
class RelatedLessThan(RelatedLookupMixin, LessThan): ...
|
||||
class RelatedGreaterThan(RelatedLookupMixin, GreaterThan): ...
|
||||
class RelatedGreaterThanOrEqual(RelatedLookupMixin, GreaterThanOrEqual): ...
|
||||
class RelatedLessThanOrEqual(RelatedLookupMixin, LessThanOrEqual): ...
|
||||
class RelatedIsNull(RelatedLookupMixin, IsNull): ...
|
||||
@@ -16,14 +16,14 @@ class ForeignObjectRel(FieldCacheMixin):
|
||||
name: str
|
||||
one_to_many: bool
|
||||
one_to_one: bool
|
||||
related_model: Type[django.db.models.base.Model]
|
||||
related_model: Type[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] = ...
|
||||
field: Field = ...
|
||||
model: Union[Type[Model], str] = ...
|
||||
related_name: Optional[str] = ...
|
||||
related_query_name: None = ...
|
||||
limit_choices_to: Dict[Any, Any] = ...
|
||||
@@ -37,7 +37,7 @@ class ForeignObjectRel(FieldCacheMixin):
|
||||
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]] = ...,
|
||||
limit_choices_to: Any = ...,
|
||||
parent_link: bool = ...,
|
||||
on_delete: Optional[Callable] = ...,
|
||||
) -> None: ...
|
||||
@@ -71,19 +71,19 @@ class ForeignObjectRel(FieldCacheMixin):
|
||||
def get_cache_name(self) -> str: ...
|
||||
|
||||
class ManyToOneRel(ForeignObjectRel):
|
||||
field: django.db.models.fields.related.ForeignKey
|
||||
field: ForeignKey
|
||||
hidden: bool
|
||||
limit_choices_to: Union[Callable, Dict[str, Union[int, str]], django.db.models.query_utils.Q]
|
||||
limit_choices_to: Any
|
||||
many_to_many: bool
|
||||
many_to_one: bool
|
||||
model: Union[Type[django.db.models.base.Model], str]
|
||||
model: Union[Type[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_model: Type[Model]
|
||||
related_name: Optional[str]
|
||||
related_query_name: Optional[str]
|
||||
symmetrical: bool
|
||||
@@ -103,19 +103,19 @@ class ManyToOneRel(ForeignObjectRel):
|
||||
def set_field_name(self) -> None: ...
|
||||
|
||||
class OneToOneRel(ManyToOneRel):
|
||||
field: django.db.models.fields.related.OneToOneField
|
||||
field: 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]
|
||||
model: Union[Type[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_model: Type[Model]
|
||||
related_name: Optional[str]
|
||||
related_query_name: Optional[str]
|
||||
symmetrical: bool
|
||||
@@ -133,21 +133,21 @@ class OneToOneRel(ManyToOneRel):
|
||||
) -> None: ...
|
||||
|
||||
class ManyToManyRel(ForeignObjectRel):
|
||||
field: django.db.models.fields.related.RelatedField
|
||||
field: RelatedField
|
||||
field_name: None
|
||||
hidden: bool
|
||||
limit_choices_to: Union[Callable, Dict[str, str]]
|
||||
model: Union[Type[django.db.models.base.Model], str]
|
||||
model: Union[Type[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_model: Type[Model]
|
||||
related_name: Optional[str]
|
||||
related_query_name: Optional[str]
|
||||
through: Optional[Union[Type[django.db.models.base.Model], str]] = ...
|
||||
through: Optional[Union[Type[Model], str]] = ...
|
||||
through_fields: Optional[Tuple[str, str]] = ...
|
||||
symmetrical: bool = ...
|
||||
db_constraint: bool = ...
|
||||
@@ -157,7 +157,7 @@ class ManyToManyRel(ForeignObjectRel):
|
||||
to: Union[Type[Model], str],
|
||||
related_name: Optional[str] = ...,
|
||||
related_query_name: Optional[str] = ...,
|
||||
limit_choices_to: Optional[Union[Callable, Dict[str, str]]] = ...,
|
||||
limit_choices_to: Any = ...,
|
||||
symmetrical: bool = ...,
|
||||
through: Optional[Union[Type[Model], str]] = ...,
|
||||
through_fields: Optional[Tuple[str, str]] = ...,
|
||||
@@ -13,7 +13,7 @@ class Cast(Func):
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.Field
|
||||
output_field: Field
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
template: str = ...
|
||||
@@ -29,7 +29,7 @@ class Coalesce(Func):
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.Field
|
||||
output_field: Field
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
def __init__(self, *expressions: Any, **extra: Any) -> None: ...
|
||||
@@ -41,7 +41,7 @@ class Greatest(Func):
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.Field
|
||||
output_field: Field
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
def __init__(self, *expressions: Any, **extra: Any) -> None: ...
|
||||
@@ -53,7 +53,7 @@ class Least(Func):
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.Field
|
||||
output_field: Field
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
def __init__(self, *expressions: Any, **extra: Any) -> None: ...
|
||||
31
django-stubs/db/models/functions/datetime.pyi
Normal file
31
django-stubs/db/models/functions/datetime.pyi
Normal file
@@ -0,0 +1,31 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.db.models import Func, Transform
|
||||
|
||||
class TimezoneMixin:
|
||||
tzinfo: Any = ...
|
||||
def get_tzname(self) -> Optional[str]: ...
|
||||
|
||||
class Extract(TimezoneMixin, Transform): ...
|
||||
class ExtractYear(Extract): ...
|
||||
class ExtractMonth(Extract): ...
|
||||
class ExtractDay(Extract): ...
|
||||
class ExtractWeek(Extract): ...
|
||||
class ExtractWeekDay(Extract): ...
|
||||
class ExtractQuarter(Extract): ...
|
||||
class ExtractHour(Extract): ...
|
||||
class ExtractMinute(Extract): ...
|
||||
class ExtractSecond(Extract): ...
|
||||
class Now(Func): ...
|
||||
class TruncBase(TimezoneMixin, Transform): ...
|
||||
class Trunc(TruncBase): ...
|
||||
class TruncYear(TruncBase): ...
|
||||
class TruncQuarter(TruncBase): ...
|
||||
class TruncMonth(TruncBase): ...
|
||||
class TruncWeek(TruncBase): ...
|
||||
class TruncDay(TruncBase): ...
|
||||
class TruncDate(TruncBase): ...
|
||||
class TruncTime(TruncBase): ...
|
||||
class TruncHour(TruncBase): ...
|
||||
class TruncMinute(TruncBase): ...
|
||||
class TruncSecond(TruncBase): ...
|
||||
@@ -40,7 +40,7 @@ class Concat(Func):
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.Field
|
||||
output_field: Field
|
||||
source_expressions: List[django.db.models.functions.text.ConcatPair]
|
||||
function: Any = ...
|
||||
template: str = ...
|
||||
@@ -82,7 +82,7 @@ class Lower(Transform):
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.Field
|
||||
output_field: Field
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
lookup_name: str = ...
|
||||
@@ -219,7 +219,7 @@ class Upper(Transform):
|
||||
convert_value: Callable
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.Field
|
||||
output_field: Field
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
lookup_name: str = ...
|
||||
@@ -1,39 +1,182 @@
|
||||
from collections import OrderedDict
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict, List, Optional, Tuple, Type, Union, Iterable
|
||||
|
||||
from django.db.models.expressions import Expression
|
||||
from django.db.models.fields import TextField
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.models.expressions import Combinable, Expression, Func
|
||||
from django.db.models.functions.datetime import ExtractYear
|
||||
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
|
||||
|
||||
from django.db.models import expressions, lookups
|
||||
from django.db.models.fields import TextField, related_lookups
|
||||
|
||||
class Lookup:
|
||||
lookup_name: Any = ...
|
||||
prepare_rhs: bool = ...
|
||||
can_use_none_as_rhs: bool = ...
|
||||
lhs: Any = ...
|
||||
rhs: Any = ...
|
||||
bilateral_transforms: Any = ...
|
||||
def __init__(self, lhs: Union[Expression, TextField], rhs: Any) -> None: ...
|
||||
def apply_bilateral_transforms(self, value: Expression) -> Expression: ...
|
||||
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: Any, rhs: Optional[OrderedSet] = ...
|
||||
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[Expression]) -> None: ...
|
||||
def get_prep_lookup(self) -> Any: ...
|
||||
def get_db_prep_lookup(self, value: Union[int, str], connection: Any) -> Tuple[str, List[SafeText]]: ...
|
||||
def get_db_prep_lookup(self, value: Union[int, str], connection: DatabaseWrapper) -> Tuple[str, List[SafeText]]: ...
|
||||
def process_lhs(
|
||||
self, compiler: SQLCompiler, connection: Any, lhs: Optional[Expression] = ...
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper, lhs: Optional[Expression] = ...
|
||||
) -> Tuple[str, List[Union[int, str]]]: ...
|
||||
def process_rhs(
|
||||
self, compiler: SQLCompiler, connection: Any
|
||||
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]) -> Lookup: ...
|
||||
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 get_rhs_op(self, connection: DatabaseWrapper, rhs: str) -> str: ...
|
||||
|
||||
class FieldGetDbPrepValueMixin:
|
||||
get_db_prep_lookup_value_is_iterable: bool = ...
|
||||
|
||||
class FieldGetDbPrepValueIterableMixin(FieldGetDbPrepValueMixin):
|
||||
get_db_prep_lookup_value_is_iterable: bool = ...
|
||||
def get_prep_lookup(self) -> Iterable[Any]: ...
|
||||
def resolve_expression_parameter(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper, sql: str, param: Optional[Union[Combinable, int, str]]
|
||||
) -> Tuple[str, List[None]]: ...
|
||||
|
||||
class Exact(FieldGetDbPrepValueMixin, BuiltinLookup):
|
||||
bilateral_transforms: List[Type[lookups.Transform]]
|
||||
lookup_name: str = ...
|
||||
|
||||
class IExact(BuiltinLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
lookup_name: str = ...
|
||||
|
||||
class GreaterThan(FieldGetDbPrepValueMixin, BuiltinLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
lookup_name: str = ...
|
||||
|
||||
class GreaterThanOrEqual(FieldGetDbPrepValueMixin, BuiltinLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
lookup_name: str = ...
|
||||
|
||||
class LessThan(FieldGetDbPrepValueMixin, BuiltinLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
lookup_name: str = ...
|
||||
|
||||
class LessThanOrEqual(FieldGetDbPrepValueMixin, BuiltinLookup):
|
||||
bilateral_transforms: List[Type[lookups.Transform]]
|
||||
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]]
|
||||
lookup_name: str = ...
|
||||
def get_rhs_op(self, connection: DatabaseWrapper, rhs: str) -> 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: ...
|
||||
|
||||
class Contains(PatternLookup):
|
||||
bilateral_transforms: List[Type[lookups.Transform]]
|
||||
lookup_name: str = ...
|
||||
|
||||
class IContains(Contains):
|
||||
bilateral_transforms: List[Any]
|
||||
lookup_name: str = ...
|
||||
|
||||
class StartsWith(PatternLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
lookup_name: str = ...
|
||||
param_pattern: str = ...
|
||||
|
||||
class IStartsWith(StartsWith):
|
||||
bilateral_transforms: List[Any]
|
||||
lookup_name: str = ...
|
||||
|
||||
class EndsWith(PatternLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
lookup_name: str = ...
|
||||
param_pattern: str = ...
|
||||
|
||||
class IEndsWith(EndsWith):
|
||||
bilateral_transforms: List[Any]
|
||||
lookup_name: str = ...
|
||||
|
||||
class Range(FieldGetDbPrepValueIterableMixin, BuiltinLookup):
|
||||
bilateral_transforms: List[Type[lookups.Transform]]
|
||||
lookup_name: str = ...
|
||||
|
||||
class IsNull(BuiltinLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
lookup_name: str = ...
|
||||
prepare_rhs: bool = ...
|
||||
|
||||
class Regex(BuiltinLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
lookup_name: str = ...
|
||||
prepare_rhs: bool = ...
|
||||
|
||||
class IRegex(Regex):
|
||||
bilateral_transforms: List[Any]
|
||||
lookup_name: str = ...
|
||||
|
||||
class YearLookup(Lookup):
|
||||
def year_lookup_bounds(self, connection: DatabaseWrapper, year: int) -> List[str]: ...
|
||||
|
||||
class YearComparisonLookup(YearLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
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]
|
||||
lookup_name: str = ...
|
||||
|
||||
class YearGt(YearComparisonLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
lookup_name: str = ...
|
||||
|
||||
class YearGte(YearComparisonLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
lookup_name: str = ...
|
||||
|
||||
class YearLt(YearComparisonLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
lookup_name: str = ...
|
||||
|
||||
class YearLte(YearComparisonLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
lookup_name: str = ...
|
||||
|
||||
@@ -41,7 +41,7 @@ class Options:
|
||||
FORWARD_PROPERTIES: Any = ...
|
||||
REVERSE_PROPERTIES: Any = ...
|
||||
default_apps: Any = ...
|
||||
local_fields: List[django.db.models.fields.Field] = ...
|
||||
local_fields: List[Field] = ...
|
||||
local_many_to_many: List[django.db.models.fields.related.ManyToManyField] = ...
|
||||
private_fields: List[Any] = ...
|
||||
local_managers: List[django.db.models.manager.Manager] = ...
|
||||
@@ -75,13 +75,13 @@ class Options:
|
||||
]
|
||||
]
|
||||
] = ...
|
||||
pk: Optional[django.db.models.fields.Field] = ...
|
||||
pk: Optional[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]] = ...
|
||||
concrete_model: Optional[Type[Model]] = ...
|
||||
swappable: None = ...
|
||||
parents: collections.OrderedDict = ...
|
||||
auto_created: bool = ...
|
||||
@@ -103,7 +103,7 @@ class Options:
|
||||
def app_config(self) -> AppConfig: ...
|
||||
@property
|
||||
def installed(self): ...
|
||||
model: Type[django.db.models.base.Model] = ...
|
||||
model: Type[Model] = ...
|
||||
original_attrs: Dict[str, Union[List[str], Apps, str]] = ...
|
||||
def contribute_to_class(self, cls: Type[Model], name: str) -> None: ...
|
||||
def add_manager(self, manager: Manager) -> None: ...
|
||||
@@ -32,7 +32,7 @@ class DeleteQuery(Query):
|
||||
high_mark: None
|
||||
low_mark: int
|
||||
max_depth: int
|
||||
model: Type[django.db.models.base.Model]
|
||||
model: Type[Model]
|
||||
order_by: Tuple
|
||||
select: Tuple
|
||||
select_for_update: bool
|
||||
@@ -79,12 +79,10 @@ class UpdateQuery(Query):
|
||||
high_mark: None
|
||||
low_mark: int
|
||||
max_depth: int
|
||||
model: Type[django.db.models.base.Model]
|
||||
model: Type[Model]
|
||||
order_by: Tuple
|
||||
related_ids: Optional[List[int]]
|
||||
related_updates: Dict[
|
||||
Type[django.db.models.base.Model], List[Tuple[django.db.models.fields.Field, None, Union[int, str]]]
|
||||
]
|
||||
related_updates: Dict[Type[Model], List[Tuple[Field, None, Union[int, str]]]]
|
||||
select: Tuple
|
||||
select_for_update: bool
|
||||
select_for_update_nowait: bool
|
||||
@@ -96,13 +94,7 @@ class UpdateQuery(Query):
|
||||
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: List[Tuple[Field, Optional[Type[Model]], Union[django.db.models.expressions.Case, uuid.UUID]]]
|
||||
values_select: Tuple
|
||||
where_class: Type[django.db.models.sql.where.WhereNode]
|
||||
compiler: str = ...
|
||||
@@ -139,7 +131,7 @@ class InsertQuery(Query):
|
||||
high_mark: None
|
||||
low_mark: int
|
||||
max_depth: int
|
||||
model: Type[django.db.models.base.Model]
|
||||
model: Type[Model]
|
||||
order_by: Tuple
|
||||
select: Tuple
|
||||
select_for_update: bool
|
||||
@@ -156,11 +148,9 @@ class InsertQuery(Query):
|
||||
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,
|
||||
List[django.db.models.fields.DateTimeCheckMixin], List[Field], django.utils.datastructures.ImmutableList
|
||||
] = ...
|
||||
objs: List[django.db.models.base.Model] = ...
|
||||
objs: List[Model] = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
raw: bool = ...
|
||||
def insert_values(
|
||||
@@ -191,7 +181,7 @@ class AggregateQuery(Query):
|
||||
high_mark: None
|
||||
low_mark: int
|
||||
max_depth: int
|
||||
model: Type[django.db.models.base.Model]
|
||||
model: Type[Model]
|
||||
order_by: Tuple
|
||||
select: Tuple
|
||||
select_for_update: bool
|
||||
|
||||
@@ -207,7 +207,7 @@ def inlineformset_factory(
|
||||
class InlineForeignKeyField(Field):
|
||||
disabled: bool
|
||||
help_text: str
|
||||
initial: Optional[Union[django.db.models.base.Model, int, str]]
|
||||
initial: Optional[Union[Model, int, str]]
|
||||
label: Optional[str]
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
@@ -215,7 +215,7 @@ class InlineForeignKeyField(Field):
|
||||
show_hidden_initial: bool
|
||||
widget: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
parent_instance: django.db.models.base.Model = ...
|
||||
parent_instance: Model = ...
|
||||
pk_field: bool = ...
|
||||
to_field: Optional[str] = ...
|
||||
def __init__(
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/usr/local/bin/xonsh
|
||||
|
||||
black --line-length=120 django-stubs/ django-stubs-generated/
|
||||
black --line-length=120 django-stubs/
|
||||
|
||||
Reference in New Issue
Block a user