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.contrib.contenttypes.fields.GenericForeignKey methods #2137

Merged
merged 2 commits into from
May 9, 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
5 changes: 4 additions & 1 deletion django-stubs/contrib/contenttypes/fields.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,14 @@ class GenericForeignKey(FieldCacheMixin):
def check(self, **kwargs: Any) -> list[CheckMessage]: ...
def get_cache_name(self) -> str: ...
def get_content_type(
self, obj: Model | None = ..., id: int | None = ..., using: str | None = ...
self, obj: Model | None = ..., id: int | None = ..., using: str | None = ..., model: type[Model] | None = ...
) -> ContentType: ...
def get_prefetch_queryset(
self, instances: list[Model] | QuerySet, queryset: QuerySet | None = ...
) -> tuple[list[Model], Callable, Callable, bool, str, bool]: ...
def get_prefetch_querysets(
self, instances: list[Model] | QuerySet, querysets: list[QuerySet] | None = ...
) -> tuple[list[Model], Callable, Callable, bool, str, bool]: ...
def __get__(self, instance: Model | None, cls: type[Model] | None = ...) -> Any | None: ...
def __set__(self, instance: Model, value: Any | None) -> None: ...

Expand Down
2 changes: 0 additions & 2 deletions scripts/stubtest/allowlist_todo_django50.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# Only discrepancies that appeared after Django 4.2 -> 5.0 update.
# Unsorted: there are real problems and things we can really ignore.

django.contrib.contenttypes.fields.GenericForeignKey.get_content_type
django.contrib.contenttypes.fields.GenericForeignKey.get_prefetch_querysets
django.contrib.gis.db.models.Case.allowed_default
django.contrib.gis.db.models.ExpressionWrapper.allowed_default
django.contrib.gis.db.models.F.allowed_default
Expand Down
Loading