mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-17 17:35:59 +08:00
better stubs
This commit is contained in:
@@ -1,47 +1,51 @@
|
||||
# Stubs for django.db.models.fields.reverse_related (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from .mixins import FieldCacheMixin
|
||||
from typing import Any, Optional
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.fields import AutoField, Field
|
||||
from django.db.models.fields.related import ForeignKey, ManyToManyField, RelatedField
|
||||
from django.db.models.fields.related_lookups import RelatedExact, RelatedIn, RelatedIsNull
|
||||
from django.db.models.query_utils import FilteredRelation, PathInfo
|
||||
from django.db.models.fields.related import (ForeignKey, ManyToManyField,
|
||||
OneToOneField, RelatedField)
|
||||
from django.db.models.fields.related_lookups import RelatedExact, RelatedIn
|
||||
from django.db.models.lookups import StartsWith
|
||||
from django.db.models.query_utils import PathInfo
|
||||
from django.db.models.sql.where import WhereNode
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
from .mixins import FieldCacheMixin
|
||||
|
||||
|
||||
class ForeignObjectRel(FieldCacheMixin):
|
||||
hidden: bool
|
||||
name: str
|
||||
related_model: Type[django.db.models.base.Model]
|
||||
auto_created: bool = ...
|
||||
concrete: bool = ...
|
||||
editable: bool = ...
|
||||
is_relation: bool = ...
|
||||
null: bool = ...
|
||||
field: Any = ...
|
||||
model: Any = ...
|
||||
related_name: Any = ...
|
||||
related_query_name: Any = ...
|
||||
limit_choices_to: Any = ...
|
||||
parent_link: Any = ...
|
||||
on_delete: Any = ...
|
||||
field: django.db.models.fields.related.ForeignObject = ...
|
||||
model: Type[django.db.models.base.Model] = ...
|
||||
related_name: str = ...
|
||||
related_query_name: None = ...
|
||||
limit_choices_to: Dict[Any, Any] = ...
|
||||
parent_link: bool = ...
|
||||
on_delete: Callable = ...
|
||||
symmetrical: bool = ...
|
||||
multiple: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
field: RelatedField,
|
||||
to: Any,
|
||||
to: Union[Type[Model], str],
|
||||
related_name: Optional[str] = ...,
|
||||
related_query_name: Optional[str] = ...,
|
||||
limit_choices_to: Any = ...,
|
||||
limit_choices_to: Optional[
|
||||
Union[Callable, Dict[str, Union[str, int]]]
|
||||
] = ...,
|
||||
parent_link: bool = ...,
|
||||
on_delete: Optional[Callable] = ...,
|
||||
) -> None: ...
|
||||
def hidden(self) -> bool: ...
|
||||
def name(self) -> str: ...
|
||||
@property
|
||||
def remote_field(self) -> Union[ManyToManyField, ForeignKey]: ...
|
||||
def remote_field(self) -> OneToOneField: ...
|
||||
@property
|
||||
def target_field(self) -> AutoField: ...
|
||||
def related_model(self) -> Type[Model]: ...
|
||||
@@ -51,75 +55,112 @@ class ForeignObjectRel(FieldCacheMixin):
|
||||
def one_to_one(self) -> bool: ...
|
||||
def get_lookup(
|
||||
self, lookup_name: str
|
||||
) -> Type[Union[RelatedIsNull, RelatedExact, RelatedIn]]: ...
|
||||
) -> Type[Union[RelatedExact, RelatedIn]]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
@property
|
||||
def db_type(self) -> Callable: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def get_choices(
|
||||
self, include_blank: bool = ..., blank_choice: List[Tuple[str, str]] = ...
|
||||
) -> List[Tuple[int, str]]: ...
|
||||
self, include_blank: bool = ..., blank_choice: Any = ...
|
||||
): ...
|
||||
def is_hidden(self) -> bool: ...
|
||||
def get_joining_columns(
|
||||
self
|
||||
) -> Union[Tuple[Tuple[str, str]], Tuple[Tuple[str, str], Tuple[str, str]]]: ...
|
||||
def get_joining_columns(self) -> Tuple: ...
|
||||
def get_extra_restriction(
|
||||
self, where_class: Type[WhereNode], alias: str, related_alias: str
|
||||
) -> Optional[WhereNode]: ...
|
||||
field_name: Any = ...
|
||||
) -> Optional[StartsWith]: ...
|
||||
field_name: None = ...
|
||||
def set_field_name(self) -> None: ...
|
||||
def get_accessor_name(self, model: Optional[Type[Model]] = ...) -> Optional[str]: ...
|
||||
def get_accessor_name(self, model: Optional[Type[Model]] = ...) -> str: ...
|
||||
def get_path_info(
|
||||
self, filtered_relation: Optional[FilteredRelation] = ...
|
||||
self, filtered_relation: None = ...
|
||||
) -> List[PathInfo]: ...
|
||||
def get_cache_name(self) -> str: ...
|
||||
|
||||
class ManyToOneRel(ForeignObjectRel):
|
||||
field_name: Any = ...
|
||||
field: django.db.models.fields.related.ForeignKey
|
||||
hidden: bool
|
||||
limit_choices_to: Dict[Any, Any]
|
||||
model: Type[django.db.models.base.Model]
|
||||
multiple: bool
|
||||
name: str
|
||||
on_delete: Callable
|
||||
one_to_many: bool
|
||||
one_to_one: bool
|
||||
parent_link: bool
|
||||
related_model: Type[django.db.models.base.Model]
|
||||
related_name: Optional[str]
|
||||
related_query_name: None
|
||||
symmetrical: bool
|
||||
field_name: Optional[str] = ...
|
||||
def __init__(
|
||||
self,
|
||||
field: ForeignKey,
|
||||
to: Any,
|
||||
to: Union[Type[Model], str],
|
||||
field_name: Optional[str],
|
||||
related_name: Optional[str] = ...,
|
||||
related_query_name: Optional[str] = ...,
|
||||
limit_choices_to: Any = ...,
|
||||
related_query_name: None = ...,
|
||||
limit_choices_to: Optional[
|
||||
Union[Callable, Dict[str, Union[str, int]]]
|
||||
] = ...,
|
||||
parent_link: bool = ...,
|
||||
on_delete: Callable = ...,
|
||||
) -> None: ...
|
||||
def __getstate__(self) -> Dict[str, Any]: ...
|
||||
def get_related_field(self): ...
|
||||
def get_related_field(self) -> Field: ...
|
||||
def set_field_name(self) -> None: ...
|
||||
|
||||
class OneToOneRel(ManyToOneRel):
|
||||
field: django.db.models.fields.related.OneToOneField
|
||||
field_name: str
|
||||
hidden: bool
|
||||
limit_choices_to: Dict[Any, Any]
|
||||
model: Type[django.db.models.base.Model]
|
||||
name: str
|
||||
on_delete: Callable
|
||||
parent_link: bool
|
||||
related_model: Type[django.db.models.base.Model]
|
||||
related_name: Optional[str]
|
||||
related_query_name: None
|
||||
symmetrical: bool
|
||||
multiple: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
field: Any,
|
||||
to: Any,
|
||||
field_name: Any,
|
||||
related_name: Optional[Any] = ...,
|
||||
related_query_name: Optional[Any] = ...,
|
||||
limit_choices_to: Optional[Any] = ...,
|
||||
field: OneToOneField,
|
||||
to: Union[Type[Model], str],
|
||||
field_name: Optional[str],
|
||||
related_name: None = ...,
|
||||
related_query_name: None = ...,
|
||||
limit_choices_to: None = ...,
|
||||
parent_link: bool = ...,
|
||||
on_delete: Optional[Any] = ...,
|
||||
on_delete: Callable = ...,
|
||||
) -> None: ...
|
||||
|
||||
class ManyToManyRel(ForeignObjectRel):
|
||||
through: Any = ...
|
||||
through_fields: Any = ...
|
||||
symmetrical: Any = ...
|
||||
db_constraint: Any = ...
|
||||
field: django.db.models.fields.related.ManyToManyField
|
||||
hidden: bool
|
||||
limit_choices_to: Dict[Any, Any]
|
||||
model: Union[
|
||||
django.db.migrations.writer.SettingsReference,
|
||||
Type[django.db.models.base.Model],
|
||||
]
|
||||
multiple: bool
|
||||
on_delete: None
|
||||
parent_link: bool
|
||||
related_model: Type[django.db.models.base.Model]
|
||||
related_name: Optional[str]
|
||||
related_query_name: None
|
||||
through: Optional[Type[django.db.models.base.Model]] = ...
|
||||
through_fields: None = ...
|
||||
symmetrical: bool = ...
|
||||
db_constraint: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
field: RelatedField,
|
||||
to: Any,
|
||||
field: ManyToManyField,
|
||||
to: Union[Type[Model], str],
|
||||
related_name: Optional[str] = ...,
|
||||
related_query_name: Optional[str] = ...,
|
||||
limit_choices_to: Optional[Callable] = ...,
|
||||
symmetrical: bool = ...,
|
||||
through: Optional[Union[str, Type[Model]]] = ...,
|
||||
through_fields: Optional[Tuple[str, str]] = ...,
|
||||
through: Optional[str] = ...,
|
||||
through_fields: None = ...,
|
||||
db_constraint: bool = ...,
|
||||
) -> None: ...
|
||||
def get_related_field(self) -> Field: ...
|
||||
def get_related_field(self) -> AutoField: ...
|
||||
|
||||
Reference in New Issue
Block a user