def _get_non_gfk_field(opts, name):
 field = opts.get_field(name)
 if (field.is_relation and ((field.many_to_one and (not field.related_model)) or field.one_to_many)):
  raise FieldDoesNotExist()
 if (field.is_relation and (not field.many_to_many) and hasattr(field, 'attname') and (field.attname == name)):
  raise FieldIsAForeignKeyColumnName()
 return field

def _get_non_gfk_field ( opts , name ) : field = opts . get_field ( name ) if ( field . is_relation and ( ( field . many_to_one and ( not field . related_model ) ) or field . one_to_many ) ) : raise FieldDoesNotExist ( ) if ( field . is_relation and ( not field . many_to_many ) and hasattr ( field , 'attname' ) and ( field . attname == name ) ) : raise FieldIsAForeignKeyColumnName ( ) return field
for historical reasons .