#NEWLINE# def _check_parent_chain( self , instance , name ) : #NEWLINE# #INDENT# '\n        Check if the field value can be fetched from a parent field already\n        loaded in the instance. This can be done if the to-be fetched\n        field is a primary key field.\n        ' #NEWLINE# opts = instance . _meta #NEWLINE# f = opts . get_field_by_name ( name ) [ 0 ] #NEWLINE# link_field = opts . get_ancestor_link ( f . model ) #NEWLINE# if ( f . primary_key and ( f != link_field ) ) : #NEWLINE# #INDENT# return getattr ( instance , link_field . attname ) #NEWLINE# #UNINDENT# return None