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.prefetch #2115

Merged
merged 6 commits into from
May 8, 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
9 changes: 9 additions & 0 deletions django-stubs/contrib/contenttypes/prefetch.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from typing import Any

from django.db.models import Prefetch
from django.db.models.query import QuerySet

class GenericPrefetch(Prefetch):
def __init__(self, lookup: str, querysets: list[QuerySet], to_attr: str | None = ...) -> None: ...
def __getstate__(self) -> dict[str, Any]: ...
def get_current_querysets(self, level: int) -> list[QuerySet] | None: ...
1 change: 0 additions & 1 deletion scripts/stubtest/allowlist_todo_django50.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

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
django.contrib.gis.db.models.F.allowed_default
Expand Down
1 change: 1 addition & 0 deletions tests/typecheck/test_import_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
import django.contrib.contenttypes.migrations
import django.contrib.contenttypes.models
import django.contrib.contenttypes.views
import django.contrib.contenttypes.prefetch
import django.contrib.flatpages
import django.contrib.flatpages.admin
import django.contrib.flatpages.apps
Expand Down
Loading