#29625: Expose RelatedManager._remove_prefetched_objects as public method
-------------------------------------+-------------------------------------
Reporter: Ming Qin | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: prefetch_related, | Triage Stage: Accepted
_prefetched_objects_cache |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Ming Qin):
Yeah as Tim said, `refresh_from_db()` doesn't help in this case. I did an
experiment just to confirm:
{{{
#!python
>>> book1.refresh_from_db()
>>> book1.refresh_from_db(fields=["authors"])
>>> list(book1.authors.all()) # still hits the prefetched cache
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29625#comment:3>
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/065.9e0303b9b64e372dca182cf92070a401%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.