diff --git a/rest_framework-stubs/relations.pyi b/rest_framework-stubs/relations.pyi index 6c11e4fd6..3a5f49cf0 100644 --- a/rest_framework-stubs/relations.pyi +++ b/rest_framework-stubs/relations.pyi @@ -71,9 +71,9 @@ class RelatedField(Field[_MT, Any, _PT, Any]): def iter_options(self) -> Iterable[Option]: ... def display_value(self, instance: _MT) -> str: ... -class StringRelatedField(RelatedField[_MT, str]): ... +class StringRelatedField(RelatedField[Any, str]): ... -class PrimaryKeyRelatedField(RelatedField[_MT, Any]): +class PrimaryKeyRelatedField(RelatedField[Any, Any]): pk_field: str | None def __init__( self, @@ -98,7 +98,7 @@ class PrimaryKeyRelatedField(RelatedField[_MT, Any]): pk_field: str | Field | None = ..., ) -> None: ... -class HyperlinkedRelatedField(RelatedField[_MT, Hyperlink]): +class HyperlinkedRelatedField(RelatedField[Any, Hyperlink]): reverse: Callable lookup_field: str lookup_url_kwarg: str @@ -134,7 +134,7 @@ class HyperlinkedRelatedField(RelatedField[_MT, Hyperlink]): class HyperlinkedIdentityField(HyperlinkedRelatedField): ... -class SlugRelatedField(RelatedField[_MT, str]): +class SlugRelatedField(RelatedField[Any, str]): slug_field: str | None def __init__( self,