From 240e4b72ebace61c9b60d5431d1adc66744fcf8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Magimel?= Date: Tue, 7 May 2024 13:56:44 +0000 Subject: [PATCH] fix(relations): replace the model type var with Any Ref #168 --- rest_framework-stubs/relations.pyi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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,