mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-05-24 17:28:41 +08:00
cleanups
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import collections
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Set, Tuple, Type, Union, TypeVar, Generic
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Set, Tuple, Type, Union, TypeVar, Generic, Sequence
|
||||
|
||||
from django.apps.config import AppConfig
|
||||
from django.apps.registry import Apps
|
||||
@@ -45,22 +45,22 @@ class Options(Generic[_M]):
|
||||
local_many_to_many: List[ManyToManyField] = ...
|
||||
private_fields: List[Any] = ...
|
||||
local_managers: List[Manager] = ...
|
||||
base_manager_name: None = ...
|
||||
default_manager_name: None = ...
|
||||
base_manager_name: Optional[str] = ...
|
||||
default_manager_name: Optional[str] = ...
|
||||
model_name: Optional[str] = ...
|
||||
verbose_name: Optional[str] = ...
|
||||
verbose_name_plural: Optional[str] = ...
|
||||
db_table: str = ...
|
||||
ordering: List[str] = ...
|
||||
ordering: Optional[List[str]] = ...
|
||||
indexes: List[Any] = ...
|
||||
unique_together: Union[List[Any], Tuple] = ...
|
||||
index_together: Union[List[Any], Tuple] = ...
|
||||
select_on_save: bool = ...
|
||||
default_permissions: Tuple[str, str, str, str] = ...
|
||||
default_permissions: Sequence[str] = ...
|
||||
permissions: List[Any] = ...
|
||||
object_name: Optional[str] = ...
|
||||
app_label: str = ...
|
||||
get_latest_by: None = ...
|
||||
get_latest_by: Optional[Sequence[str]] = ...
|
||||
order_with_respect_to: None = ...
|
||||
db_tablespace: str = ...
|
||||
required_db_features: List[Any] = ...
|
||||
@@ -78,7 +78,7 @@ class Options(Generic[_M]):
|
||||
auto_created: bool = ...
|
||||
related_fkey_lookups: List[Any] = ...
|
||||
apps: Apps = ...
|
||||
default_related_name: None = ...
|
||||
default_related_name: Optional[str] = ...
|
||||
model: Type[Model] = ...
|
||||
original_attrs: Dict[str, Any] = ...
|
||||
def __init__(self, meta: Optional[type], app_label: Optional[str] = ...) -> None: ...
|
||||
|
||||
@@ -2,8 +2,8 @@ import collections
|
||||
from collections import OrderedDict, namedtuple
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Sequence, Set, Tuple, Type, Union
|
||||
|
||||
from django.db.models.lookups import Lookup
|
||||
from django.db.models.query_utils import PathInfo
|
||||
from django.db.models.lookups import Lookup, Transform
|
||||
from django.db.models.query_utils import PathInfo, RegisterLookupMixin
|
||||
from django.db.models.sql.compiler import SQLCompiler
|
||||
from django.db.models.sql.datastructures import BaseTable
|
||||
from django.db.models.sql.where import WhereNode
|
||||
@@ -69,6 +69,8 @@ class Query:
|
||||
explain_query: bool = ...
|
||||
explain_format: Optional[str] = ...
|
||||
explain_options: Dict[str, int] = ...
|
||||
high_mark: Optional[int] = ...
|
||||
low_mark: int = ...
|
||||
def __init__(self, model: Optional[Type[Model]], where: Type[WhereNode] = ...) -> None: ...
|
||||
@property
|
||||
def extra(self) -> OrderedDict: ...
|
||||
@@ -141,8 +143,6 @@ class Query:
|
||||
) -> 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: ...
|
||||
@@ -178,7 +178,10 @@ class Query:
|
||||
def set_values(self, fields: Union[List[str], Tuple]) -> None: ...
|
||||
def trim_start(self, names_with_path: List[Tuple[str, List[PathInfo]]]) -> Tuple[str, bool]: ...
|
||||
def is_nullable(self, field: Field) -> bool: ...
|
||||
def build_lookup(self, lookups: Sequence[str], lhs: Query, rhs: Optional[Query]) -> Lookup: ...
|
||||
def build_lookup(
|
||||
self, lookups: Sequence[str], lhs: Union[RegisterLookupMixin, Query], rhs: Optional[Query]
|
||||
) -> Lookup: ...
|
||||
def try_transform(self, lhs: Union[RegisterLookupMixin, Query], name: str) -> Transform: ...
|
||||
|
||||
class JoinPromoter:
|
||||
connector: str = ...
|
||||
|
||||
@@ -1,104 +1,25 @@
|
||||
import collections
|
||||
import uuid
|
||||
from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, Type, Union
|
||||
from typing import Any, Dict, Iterable, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.expressions import Case
|
||||
from django.db.models.query import QuerySet
|
||||
from django.db.models.sql.datastructures import BaseTable
|
||||
from django.db.models.sql.query import Query
|
||||
from django.db.models.sql.where import WhereNode
|
||||
|
||||
from django.db.models.fields import Field
|
||||
|
||||
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[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[WhereNode]
|
||||
compiler: str = ...
|
||||
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_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[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: List[Tuple[Field, Optional[Type[Model]], Union[Case, uuid.UUID]]]
|
||||
values_select: Tuple
|
||||
where_class: Type[WhereNode]
|
||||
compiler: str = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def clone(self) -> UpdateQuery: ...
|
||||
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: ...
|
||||
@@ -107,87 +28,18 @@ class UpdateQuery(Query):
|
||||
def get_related_updates(self) -> List[UpdateQuery]: ...
|
||||
|
||||
class InsertQuery(Query):
|
||||
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[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: WhereNode
|
||||
where_class: Type[WhereNode]
|
||||
compiler: str = ...
|
||||
fields: Iterable[Field] = ...
|
||||
objs: List[Model] = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
raw: bool = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def insert_values(self, fields: Iterable[Field], objs: List[Model], raw: bool = ...) -> None: ...
|
||||
|
||||
class AggregateQuery(Query):
|
||||
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[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
|
||||
table_map: Dict[Any, Any]
|
||||
used_aliases: Set[Any]
|
||||
values_select: Tuple
|
||||
where: WhereNode
|
||||
where_class: Type[WhereNode]
|
||||
compiler: str = ...
|
||||
def add_subquery(self, query: Query, using: str) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user