Skip to content

Commit

Permalink
[5.0.x] Fixed #35392, Refs #34331 -- Allowed importing aprefetch_rela…
Browse files Browse the repository at this point in the history
…ted_objects from django.db.models.

Thanks James Ostrander for the report and fix, and to Tim Graham and
Mariusz Felisiak for the reviews.

Backport of 36b7024 from main
  • Loading branch information
jlost authored and nessita committed Apr 22, 2024
1 parent a42a2fa commit ea81c9d
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 @@ -45,7 +45,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 @@ -102,6 +107,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 ea81c9d

Please sign in to comment.