#35392: aprefetch_related_objects cannot be imported from django.db.models
-------------------------------------+-------------------------------------
Reporter: James | Owner: nobody
Ostrander |
Type: | Status: new
Uncategorized |
Component: Database | Version: 5.0
layer (models, ORM) | Keywords: prefetch, async,
Severity: Normal | orm
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
{{{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.
--
Ticket URL: <
https://code.djangoproject.com/ticket/35392>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.