This repository has been archived by the owner on Feb 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
prefetch_related() that uses a Prefetch with a queryset is not joining correctly #129
Labels
Comments
brki
added a commit
to brki/cleanerversion
that referenced
this issue
Feb 3, 2017
…h queryset) This commit is for Django 1.8.x. This should be easily adaptable to work with Django 1.9+, too: See get_prefetch_queryset() in django.db.models.field.related_descriptors.ForwardManyToOneDescriptor.
brki
added a commit
that referenced
this issue
Feb 3, 2017
This commit is for Django 1.8.x. This should be easily adaptable to work with Django 1.9+, too: See get_prefetch_queryset() in django.db.models.field.related_descriptors.ForwardManyToOneDescriptor.
brki
added a commit
to brki/cleanerversion
that referenced
this issue
Feb 6, 2017
…h queryset) This commit is for Django 1.8.x. This should be easily adaptable to work with Django 1.9+, too: See get_prefetch_queryset() in django.db.models.field.related_descriptors.ForwardManyToOneDescriptor.
brki
added a commit
that referenced
this issue
Feb 6, 2017
This commit is for Django 1.8.x. This should be easily adaptable to work with Django 1.9+, too: See get_prefetch_queryset() in django.db.models.field.related_descriptors.ForwardManyToOneDescriptor.
brki
added a commit
that referenced
this issue
Feb 6, 2017
This commit is for Django 1.8.x. This should be easily adaptable to work with Django 1.9+, too: See get_prefetch_queryset() in django.db.models.field.related_descriptors.ForwardManyToOneDescriptor.
maennel
added a commit
that referenced
this issue
Feb 9, 2017
Fix for #129 (prefetch_related foreign_key-related object with queryset)
TODO: create a new release. |
Can be closed with PR #140 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Here is a failing test that can be added to
versions_tests.tests.test_models.PrefetchingHistoricTests
:The second-to-last assertion fails.
Inspecting the generated query, I can see that it tries to select the related objects using ids. It should however select using identities and an as_of clause.
I suspect that the
VersionedReverseSingleRelatedObjectDescriptor
needs to have a customget_prefetch_queryset()
implementation.It probably makes sense to merge the Django-1.9-compatibility code before fixing this.
The text was updated successfully, but these errors were encountered: