mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-19 18:31:15 +08:00
fourth iteration
This commit is contained in:
@@ -3,19 +3,13 @@ from uuid import UUID
|
||||
|
||||
from django.core.checks.messages import Error, Warning
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.migrations.writer import SettingsReference
|
||||
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.mixins import FieldCacheMixin
|
||||
from django.db.models.fields.related_lookups import (RelatedGreaterThan,
|
||||
RelatedGreaterThanOrEqual,
|
||||
RelatedIn, RelatedIsNull,
|
||||
RelatedLessThan,
|
||||
RelatedLessThanOrEqual)
|
||||
from django.db.models.fields.reverse_related import (ForeignObjectRel,
|
||||
ManyToManyRel,
|
||||
ManyToOneRel)
|
||||
from django.db.models.lookups import Exact
|
||||
ManyToOneRel, OneToOneRel)
|
||||
from django.db.models.query import QuerySet
|
||||
from django.db.models.query_utils import PathInfo, Q
|
||||
from django.db.models.sql.where import WhereNode
|
||||
@@ -63,27 +57,18 @@ class RelatedField(FieldCacheMixin, Field):
|
||||
) -> None: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Union[
|
||||
Tuple[
|
||||
str,
|
||||
List[Any],
|
||||
) -> Tuple[
|
||||
str,
|
||||
List[Any],
|
||||
Union[
|
||||
Dict[str, Union[Callable, bool, str]],
|
||||
Dict[str, Union[Dict[str, Union[int, str]], bool]],
|
||||
Dict[str, Union[Dict[str, bool], bool, str]],
|
||||
],
|
||||
Union[
|
||||
Dict[str, Union[Callable, bool, str]],
|
||||
Dict[str, Union[Dict[str, Union[int, str]], bool]],
|
||||
],
|
||||
Tuple[
|
||||
str,
|
||||
List[Any],
|
||||
Union[
|
||||
Dict[str, Union[Callable, bool, str]],
|
||||
Dict[str, Union[Dict[str, bool], bool, str]],
|
||||
],
|
||||
Union[
|
||||
Dict[str, Union[Callable, bool, str]],
|
||||
Dict[str, Union[Dict[str, bool], bool, str]],
|
||||
],
|
||||
],
|
||||
Tuple[
|
||||
str, str, List[Any], Dict[str, Union[Dict[str, bool], bool, str]]
|
||||
Dict[str, Union[Dict[str, bool], bool, str]],
|
||||
],
|
||||
]: ...
|
||||
def get_forward_related_filter(
|
||||
@@ -135,40 +120,19 @@ class ForeignObject(RelatedField):
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Union[
|
||||
Tuple[None, str, List[Any], Dict[str, Any]],
|
||||
Tuple[str, List[Any], Dict[str, Any], Dict[str, Any]],
|
||||
Tuple[
|
||||
None,
|
||||
str,
|
||||
str,
|
||||
List[Any],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Callable,
|
||||
Dict[str, Union[int, str]],
|
||||
List[None],
|
||||
List[str],
|
||||
bool,
|
||||
str,
|
||||
Callable, Dict[str, Union[int, str]], List[str], bool, str
|
||||
],
|
||||
],
|
||||
],
|
||||
Tuple[
|
||||
str,
|
||||
str,
|
||||
List[Any],
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Callable,
|
||||
Dict[str, Union[int, str]],
|
||||
List[str],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
Dict[str, Union[Callable, List[None], List[str], bool, str]],
|
||||
],
|
||||
],
|
||||
]: ...
|
||||
def resolve_related_fields(self) -> List[Tuple[Field, Field]]: ...
|
||||
@property
|
||||
@@ -205,22 +169,7 @@ class ForeignObject(RelatedField):
|
||||
) -> List[PathInfo]: ...
|
||||
def get_reverse_path_info(self, filtered_relation: Optional[Any] = ...): ...
|
||||
@classmethod
|
||||
def get_lookups(
|
||||
cls
|
||||
) -> Dict[
|
||||
str,
|
||||
Type[
|
||||
Union[
|
||||
RelatedGreaterThan,
|
||||
RelatedGreaterThanOrEqual,
|
||||
RelatedIn,
|
||||
RelatedIsNull,
|
||||
RelatedLessThan,
|
||||
RelatedLessThanOrEqual,
|
||||
Exact,
|
||||
]
|
||||
],
|
||||
]: ...
|
||||
def get_lookups(cls) -> Dict[str, Type[Any]]: ...
|
||||
def contribute_to_class(
|
||||
self,
|
||||
cls: Type[Model],
|
||||
@@ -261,23 +210,31 @@ class ForeignKey(ForeignObject):
|
||||
self
|
||||
) -> Union[
|
||||
Tuple[
|
||||
None,
|
||||
str,
|
||||
List[Any],
|
||||
Dict[str, Union[Callable, Dict[str, Union[int, str]], str]],
|
||||
Dict[str, Union[Callable, Dict[str, Union[int, str]], str]],
|
||||
],
|
||||
Tuple[
|
||||
str,
|
||||
List[Any],
|
||||
Union[
|
||||
Dict[str, Union[Callable, Dict[str, Union[int, str]], str]],
|
||||
Dict[str, Union[Callable, Dict[str, bool], str]],
|
||||
Dict[str, Union[Callable, bool, str]],
|
||||
],
|
||||
Union[
|
||||
Dict[str, Union[Callable, Dict[str, Union[int, str]], str]],
|
||||
Dict[str, Union[Callable, Dict[str, bool], str]],
|
||||
Dict[str, Union[Callable, bool, str]],
|
||||
],
|
||||
],
|
||||
Tuple[
|
||||
str,
|
||||
str,
|
||||
List[Any],
|
||||
Dict[str, Union[Callable, bool, SettingsReference]],
|
||||
],
|
||||
]: ...
|
||||
def to_python(self, value: Union[int, str]) -> int: ...
|
||||
@property
|
||||
@@ -320,7 +277,7 @@ class ForeignKey(ForeignObject):
|
||||
def get_col(
|
||||
self,
|
||||
alias: str,
|
||||
output_field: Optional[Union[Field, mixins.FieldCacheMixin]] = ...,
|
||||
output_field: Optional[Union[Field, OneToOneRel]] = ...,
|
||||
) -> Col: ...
|
||||
|
||||
class OneToOneField(ForeignKey):
|
||||
@@ -341,14 +298,11 @@ class OneToOneField(ForeignKey):
|
||||
) -> None: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Union[
|
||||
Tuple[
|
||||
str,
|
||||
List[Any],
|
||||
Dict[str, Union[Callable, bool, str]],
|
||||
Dict[str, Union[Callable, bool, str]],
|
||||
],
|
||||
Tuple[str, str, List[Any], Dict[str, Union[Callable, str]]],
|
||||
) -> Tuple[
|
||||
str,
|
||||
List[Any],
|
||||
Dict[str, Union[Callable, bool, str]],
|
||||
Dict[str, Union[Callable, bool, str]],
|
||||
]: ...
|
||||
def formfield(self, **kwargs: Any) -> None: ...
|
||||
def save_form_data(
|
||||
@@ -385,18 +339,18 @@ class ManyToManyField(RelatedField):
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Union[
|
||||
Tuple[None, str, List[Any], Dict[str, Union[bool, str]]],
|
||||
Tuple[
|
||||
str,
|
||||
List[Any],
|
||||
Dict[str, Union[Callable, str]],
|
||||
Dict[str, Union[Callable, str]],
|
||||
],
|
||||
Tuple[
|
||||
str,
|
||||
List[Any],
|
||||
Dict[str, Union[bool, str]],
|
||||
Dict[str, Union[bool, str]],
|
||||
Union[Dict[str, Union[Callable, str]], Dict[str, Union[bool, str]]],
|
||||
Union[
|
||||
Dict[str, Union[Callable, str]],
|
||||
Dict[str, Union[bool, str]],
|
||||
Dict[str, str],
|
||||
],
|
||||
],
|
||||
Tuple[str, str, List[Any], Dict[str, Union[Callable, str]]],
|
||||
]: ...
|
||||
def get_path_info(
|
||||
self, filtered_relation: None = ...
|
||||
|
||||
Reference in New Issue
Block a user