fks_to_parent is a list containing f for every f in opts.fields, only if f is an instance of ForeignKey,
fks_to_parent = [ f for f in opts . fields if isinstance ( f , ForeignKey ) and ( f . rel . to == parent_model or f . rel . to in parent_model . _meta . get_parent_list ( ) ) ]