Ticket #18090: ticket_18090.diff
File ticket_18090.diff, 668 bytes (added by , 13 years ago) |
---|
-
django/db/models/fields/related.py
diff -r 0296323919a2 django/db/models/fields/related.py
a b 239 239 def get_prefetch_query_set(self, instances): 240 240 vals = set(instance._get_pk_val() for instance in instances) 241 241 params = {'%s__pk__in' % self.related.field.name: vals} 242 return (self.get_query_set(instance=instances[0]) ,242 return (self.get_query_set(instance=instances[0]).filter(params), 243 243 attrgetter(self.related.field.attname), 244 244 lambda obj: obj._get_pk_val(), 245 245 True,