#29230: Incorrect behavior of QuerySet.prefetch_related() in some circumstances
during multilevel data prefetching
-------------------------------------+-------------------------------------
Reporter: Alex Sichkar | Owner: Paulo
Type: Bug | Status: assigned
Component: Database layer | Version: 1.11
(models, ORM) |
Severity: Normal | Resolution:
Keywords: prefetch_related | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Paulo):
PR: https://github.com/django/django/pull/9995
The commit in
https://code.djangoproject.com/changeset/379caf397ea41923278821085204c296f960e70e/
didn't fix this.
It just reversed the execution order of prefetch objects.
Changing the attached test from:
{{{
projects = Project.objects.prefetch_related(
Prefetch('tasks', queryset=tasks),
Prefetch('tasks', to_attr='some_attr_name'),
)
}}}
to:
{{{
projects = Project.objects.prefetch_related(
Prefetch('tasks', to_attr='some_attr_name'),
Prefetch('tasks', queryset=tasks),
)
}}}
Made it fail again.
--
Ticket URL: <https://code.djangoproject.com/ticket/29230#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/064.92b5eaa74f1e41898e73e76c808d2db2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.