mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
[5.0.x] Fixed #35392, Refs #34331 -- Allowed importing aprefetch_related_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 36b7024b7f from main
This commit is contained in:
@@ -45,7 +45,12 @@ from django.db.models.indexes import * # NOQA
|
||||
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
|
||||
@@ -102,6 +107,7 @@ __all__ += [
|
||||
"Prefetch",
|
||||
"Q",
|
||||
"QuerySet",
|
||||
"aprefetch_related_objects",
|
||||
"prefetch_related_objects",
|
||||
"DEFERRED",
|
||||
"Model",
|
||||
|
||||
@@ -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`).
|
||||
|
||||
Reference in New Issue
Block a user