#36282: Prefetched relations are not used from parent classes in all cases
-------------------------------------+-------------------------------------
Reporter: Take Weiland | Owner: (none)
Type: Bug | Status: new
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: mti | Triage Stage: Accepted
prefetch_related |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Take Weiland):
Replying to [comment:2 Simon Charette]:
Thank you for your pointers. I have already started working on this here:
https://github.com/django/django/compare/main...diesieben07:django:prefetch_related_inheritance
I will work on polishing it to get it ready for a contribution. One thing
to think about is indeed cache invalidation. If you do
`parent.child.m2m_relation.set(...)` should that invalidate
`parent.m2m_relation`? Currently it doesn't, but if
`parent.child.m2m_relation` and `parent.m2m_relation` now point to the
same cache, because the child one just looks in its parent...?
Probably the clearing also needs to happen recursively and walk up to the
parents, but that is a potentially more invasive change.
--
Ticket URL: <https://code.djangoproject.com/ticket/36282#comment:6>
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 view this discussion visit
https://groups.google.com/d/msgid/django-updates/01070195f2c72a4f-279a1737-5849-4f27-bc3f-9847259f6717-000000%40eu-central-1.amazonses.com.