#25279: Make prefetch_related_objects a public API
----------------------------------------------+--------------------
Reporter: adamchainz | Owner: nobody
Type: New feature | Status: new
Component: Database layer (models, ORM) | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+--------------------
`prefetch_related` is great, but it would be nice to be able to reuse its
capabilities with lists of model instances already retrieved by other code
(or from cache, or newly constructed, etc.). It seems this is possible by
using `django.db.models.query.prefetch_related_objects` which is the
function implementing all the prefetch capability - I've just seen it used
fine, however it is not part of Django's public API.
As far as I can tell, just doing an `import` in
`django.db.models.__init__` and adding documentation should be enough to
make it public, since `prefetch_related_objects` contains all the
functionality that `prefetch_related` exposes.
--
Ticket URL: <https://code.djangoproject.com/ticket/25279>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/053.824e349b0c8eec33a2fba6fd81d3cacc%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.