Skip to content

@loic /foo.diff
Last active

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py
index 6299b20..577f503 100644
--- a/django/db/models/fields/related.py
+++ b/django/db/models/fields/related.py
@@ -268,7 +268,7 @@ class ReverseSingleRelatedObjectDescriptor(six.with_metaclass(RenameRelatedObjec
rel_obj_attr = self.field.get_foreign_related_value
instance_attr = self.field.get_local_related_value
instances_dict = dict((instance_attr(inst), inst) for inst in instances)
- query = {'%s__in' % self.field.related_query_name(): instances}
+ query = {'%s__in' % self.field.related_field.name: set([instance_attr(i)[0] for i in instances])}
qs = self.get_queryset(instance=instances[0]).filter(**query)
# Since we're going to assign directly in the cache,
# we must manage the reverse relation cache manually.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.