Skip to content

Commit 5216eaf

Browse files
authored
5.0: Update django.contrib.contenttypes.fields (#2137)
1 parent 059e8f6 commit 5216eaf

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

django-stubs/contrib/contenttypes/fields.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,14 @@ class GenericForeignKey(FieldCacheMixin):
4444
def check(self, **kwargs: Any) -> list[CheckMessage]: ...
4545
def get_cache_name(self) -> str: ...
4646
def get_content_type(
47-
self, obj: Model | None = ..., id: int | None = ..., using: str | None = ...
47+
self, obj: Model | None = ..., id: int | None = ..., using: str | None = ..., model: type[Model] | None = ...
4848
) -> ContentType: ...
4949
def get_prefetch_queryset(
5050
self, instances: list[Model] | QuerySet, queryset: QuerySet | None = ...
5151
) -> tuple[list[Model], Callable, Callable, bool, str, bool]: ...
52+
def get_prefetch_querysets(
53+
self, instances: list[Model] | QuerySet, querysets: list[QuerySet] | None = ...
54+
) -> tuple[list[Model], Callable, Callable, bool, str, bool]: ...
5255
def __get__(self, instance: Model | None, cls: type[Model] | None = ...) -> Any | None: ...
5356
def __set__(self, instance: Model, value: Any | None) -> None: ...
5457

scripts/stubtest/allowlist_todo_django50.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
# Only discrepancies that appeared after Django 4.2 -> 5.0 update.
33
# Unsorted: there are real problems and things we can really ignore.
44

5-
django.contrib.contenttypes.fields.GenericForeignKey.get_content_type
6-
django.contrib.contenttypes.fields.GenericForeignKey.get_prefetch_querysets
75
django.contrib.gis.db.models.Case.allowed_default
86
django.contrib.gis.db.models.ExpressionWrapper.allowed_default
97
django.contrib.gis.db.models.F.allowed_default

0 commit comments

Comments
 (0)