def to_python(self, value):  # type: ignore[no-untyped-def]
        """
        Override to allow string values; used by our custom deserializer
        to support import/export using natural keys
        """
        if value is None:
            return value
        if isinstance(value, str):
            return value
        try:
            return int(value)
        except (TypeError, ValueError):
            raise exceptions.ValidationError(
                self.error_messages["invalid"],
                code="invalid",
                params={"value": value},
            )

        Override to allow string values; used by our custom deserializer
        to support import/export using natural keys
        
api/metadata/fields.py