'Check if the field value can be fetched from a parent field already
loaded in the instance. This can be done if the to-be fetched
field is a primary key field.'

def _check_parent_chain(self, instance, name):

    opts = instance._meta
    f = opts.get_field_by_name(name)[0]
    link_field = opts.get_ancestor_link(f.model)
    if (f.primary_key and (f != link_field)):
        return getattr(instance, link_field.attname)
    return None
