Skip to content

Commit

Permalink
Fixed #35392, Refs #34331 -- Allowed importing aprefetch_related_obje…
Browse files Browse the repository at this point in the history
…cts from django.db.models.

Thanks James Ostrander for the report and fix, and to Tim Graham and
Mariusz Felisiak for the reviews.
  • Loading branch information
jlost authored and nessita committed Apr 22, 2024
1 parent 53719d6 commit 36b7024
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 7 additions & 1 deletion django/db/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@
from django.db.models.indexes import __all__ as indexes_all
from django.db.models.lookups import Lookup, Transform
from django.db.models.manager import Manager
from django.db.models.query import Prefetch, QuerySet, prefetch_related_objects
from django.db.models.query import (
Prefetch,
QuerySet,
aprefetch_related_objects,
prefetch_related_objects,
)
from django.db.models.query_utils import FilteredRelation, Q

# Imports that would create circular imports if sorted
Expand Down Expand Up @@ -104,6 +109,7 @@
"Prefetch",
"Q",
"QuerySet",
"aprefetch_related_objects",
"prefetch_related_objects",
"DEFERRED",
"Model",
Expand Down
3 changes: 3 additions & 0 deletions docs/releases/5.0.5.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ Bugfixes
* Fixed a bug in Django 5.0 that caused a crash when applying migrations
including alterations to ``GeneratedField`` such as setting ``db_index=True``
on SQLite (:ticket:`35373`).

* Allowed importing ``aprefetch_related_objects`` from ``django.db.models``
(:ticket:`35392`).

0 comments on commit 36b7024

Please sign in to comment.