diff --git a/django/contrib/contenttypes/generic.py b/django/contrib/contenttypes/generic.py
index bffd969..82e657d 100644
a
|
b
|
class GenericRelation(ForeignObject):
|
240 | 240 | |
241 | 241 | """ |
242 | 242 | return self.rel.to._base_manager.db_manager(using).filter(**{ |
243 | | "%s__pk" % self.content_type_field_name: |
244 | | ContentType.objects.db_manager(using).get_for_model( |
245 | | self.model, for_concrete_model=self.for_concrete_model).pk, |
246 | | "%s__in" % self.object_id_field_name: |
247 | | [obj.pk for obj in objs] |
248 | | }) |
| 243 | "%s__pk" % self.content_type_field_name: |
| 244 | ContentType.objects.db_manager(using).get_for_model( |
| 245 | self.model, for_concrete_model=self.for_concrete_model).pk, |
| 246 | "%s__in" % self.object_id_field_name: |
| 247 | [obj.pk for obj in objs] |
| 248 | }) |
249 | 249 | |
250 | 250 | |
251 | 251 | class ReverseGenericRelatedObjectsDescriptor(object): |
… |
… |
def create_generic_related_manager(superclass):
|
353 | 353 | query = { |
354 | 354 | '%s__pk' % self.content_type_field_name: self.content_type.id, |
355 | 355 | '%s__in' % self.object_id_field_name: |
356 | | set(obj._get_pk_val() for obj in instances) |
| 356 | set(obj._get_pk_val() for obj in instances) |
357 | 357 | } |
358 | 358 | qs = super(GenericRelatedObjectManager, self).get_queryset().using(db).filter(**query) |
359 | 359 | # We (possibly) need to convert object IDs to the type of the |