Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.0: Update django.db.models.field.related_descriptors #2157

Merged
merged 2 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions django-stubs/db/models/fields/related_descriptors.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,19 @@ class ForwardManyToOneDescriptor(Generic[_F]):
@cached_property
def RelatedObjectDoesNotExist(self) -> type[ObjectDoesNotExist]: ...
def is_cached(self, instance: Model) -> bool: ...
def get_queryset(self, **hints: Any) -> QuerySet: ...
def get_queryset(self, **hints: Any) -> QuerySet[Any]: ...
def get_prefetch_queryset(
self, instances: list[Model], queryset: QuerySet | None = ...
) -> tuple[QuerySet, Callable, Callable, bool, str, bool]: ...
self, instances: list[Model], queryset: QuerySet[Any] | None = ...
) -> tuple[QuerySet[Any], Callable[..., Any], Callable[..., Any], bool, str, bool]: ...
def get_prefetch_querysets(
self, instances: list[Model], querysets: list[QuerySet[Any]] | None = ...
) -> tuple[QuerySet[Any], Callable[..., Any], Callable[..., Any], bool, str, bool]: ...
def get_object(self, instance: Model) -> Model: ...
def __get__(
self, instance: Model | None, cls: type[Model] | None = ...
) -> Model | ForwardManyToOneDescriptor | None: ...
def __set__(self, instance: Model, value: Model | None) -> None: ...
def __reduce__(self) -> tuple[Callable, tuple[type[Model], str]]: ...
def __reduce__(self) -> tuple[Callable[..., Any], tuple[type[Model], str]]: ...

class ForwardOneToOneDescriptor(ForwardManyToOneDescriptor[_F]):
def get_object(self, instance: Model) -> Model: ...
Expand All @@ -60,6 +63,9 @@ class ReverseOneToOneDescriptor(Generic[_From, _To]):
def get_prefetch_queryset(
self, instances: list[_From], queryset: QuerySet[_To] | None = ...
) -> tuple[QuerySet[_To], Callable[..., Any], Callable[..., Any], bool, str, bool]: ...
def get_prefetch_querysets(
JaeHyuckSa marked this conversation as resolved.
Show resolved Hide resolved
self, instances: list[_From], querysets: list[QuerySet[_To]] | None = ...
) -> tuple[QuerySet[_To], Callable[..., Any], Callable[..., Any], bool, str, bool]: ...
@overload
def __get__(self, instance: None, cls: Any = ...) -> ReverseOneToOneDescriptor[_From, _To]: ...
@overload
Expand Down
4 changes: 0 additions & 4 deletions scripts/stubtest/allowlist_todo_django50.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ django.db.models.expressions.Func.allowed_default
django.db.models.expressions.When.allowed_default
django.db.models.fields.Field._get_flatchoices
django.db.models.fields.related.ForeignKey.cast_db_type
django.db.models.fields.related.ForwardManyToOneDescriptor.get_prefetch_querysets
django.db.models.fields.related.ReverseOneToOneDescriptor.get_prefetch_querysets
django.db.models.fields.related_descriptors.ForwardManyToOneDescriptor.get_prefetch_querysets
django.db.models.fields.related_descriptors.ReverseOneToOneDescriptor.get_prefetch_querysets
django.db.models.lookups.Lookup.allowed_default
django.template.autoreload

Expand Down
Loading