'Return the cacheable value for a field.
ForeignKey\'s will cache via the primary key rather than using an
instance ref. This is needed due to the way lifecycle of models works
as otherwise we end up doing wasteful queries.'

def __value_for_field(self, instance, key):

    if (key == 'pk'):
        return instance.pk
    field = instance._meta.get_field(key)
    return getattr(instance, field.attname)
