#35392 closed Bug (fixed)
aprefetch_related_objects cannot be imported from django.db.models
Reported by: | James Ostrander | Owned by: | James Ostrander |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 5.0 |
Severity: | Release blocker | Keywords: | prefetch, async, orm |
Cc: | James Ostrander | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
aprefetch_related_objects
cannot be imported from django.db.models
like prefetch_related_objects
can. Because the docs (https://docs.djangoproject.com/en/5.0/ref/models/querysets/#prefetch-related-objects) say nothing about importing the async version from a different place, I believe this to be an oversight.
You can work around this by importing from django.db.models.query
but if that's the intended behavior, the documentation should be updated to reflect that. Let me know and I'll do so happily! Otherwise, see my attached patch for a fix to the import.
Change History (6)
comment:1 by , 8 months ago
follow-up: 3 comment:2 by , 8 months ago
Needs documentation: | set |
---|---|
Owner: | changed from | to
Severity: | Normal → Release blocker |
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → Bug |
Good catch. It's a bug in fff14736f1cc594f79ea0e2656b8375d837b7aca. Please add a release note to the 5.0.5.txt
.
comment:3 by , 8 months ago
comment:4 by , 8 months ago
Needs documentation: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
https://github.com/django/django/pull/18091