From ce904fe8aa24e06b0b4f65be9661bbc31a65b638 Mon Sep 17 00:00:00 2001 From: SaJH Date: Thu, 9 May 2024 12:43:31 +0900 Subject: [PATCH] 5.0: Update django.contrib.contenttypes.fields --- django-stubs/contrib/contenttypes/fields.pyi | 5 ++++- scripts/stubtest/allowlist_todo_django50.txt | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/django-stubs/contrib/contenttypes/fields.pyi b/django-stubs/contrib/contenttypes/fields.pyi index 309208e9e..0e30ab039 100644 --- a/django-stubs/contrib/contenttypes/fields.pyi +++ b/django-stubs/contrib/contenttypes/fields.pyi @@ -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: ... diff --git a/scripts/stubtest/allowlist_todo_django50.txt b/scripts/stubtest/allowlist_todo_django50.txt index 2818f0ace..3bc79ca76 100644 --- a/scripts/stubtest/allowlist_todo_django50.txt +++ b/scripts/stubtest/allowlist_todo_django50.txt @@ -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.contenttypes.prefetch django.contrib.gis.db.models.Case.allowed_default django.contrib.gis.db.models.ExpressionWrapper.allowed_default