Ticket #34819: gfk-prefetch.patch

File gfk-prefetch.patch, 513 bytes (added by Richard Laager, 14 months ago)
  • django/contrib/contenttypes/fields.py

    diff --git a/django/contrib/contenttypes/fields.py b/django/contrib/contenttypes/fields.py
    index 35fcd0d908..054780b8de 100644
    a b class GenericForeignKey(FieldCacheMixin):  
    216216
    217217        return (
    218218            ret_val,
    219             lambda obj: (obj.pk, obj.__class__),
     219            lambda obj: (obj._meta.pk.get_prep_value(obj.pk), obj.__class__),
    220220            gfk_key,
    221221            True,
    222222            self.name,
Back to Top