From 62e4bb156ec39396bb665569fc3de53852deb85f Mon Sep 17 00:00:00 2001 From: Alexandre Spaeth Date: Thu, 4 Jan 2024 10:02:10 -0800 Subject: [PATCH 1/2] Fix typing for HyperlinkedIdentityField --- rest_framework-stubs/relations.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework-stubs/relations.pyi b/rest_framework-stubs/relations.pyi index 853b51128..86aca090b 100644 --- a/rest_framework-stubs/relations.pyi +++ b/rest_framework-stubs/relations.pyi @@ -106,7 +106,7 @@ class HyperlinkedRelatedField(RelatedField[_MT, str, Hyperlink]): view_name: str | None def __init__( self, - view_name: str, + view_name: str | None = ..., *, many: bool = ..., allow_empty: bool = ..., From 740ce77319311247f87ca694068e0817cbe33903 Mon Sep 17 00:00:00 2001 From: Alexandre Spaeth Date: Tue, 19 Mar 2024 08:28:43 -0700 Subject: [PATCH 2/2] Fix allowlist --- scripts/stubtest/allowlist.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/stubtest/allowlist.txt b/scripts/stubtest/allowlist.txt index 6ac3c5266..8aa7091f4 100644 --- a/scripts/stubtest/allowlist.txt +++ b/scripts/stubtest/allowlist.txt @@ -6,12 +6,8 @@ # Comments about why things are ignored are mandatory. # Constructor arguments *appear* optional but actually throw exception -rest_framework.relations.HyperlinkedIdentityField.__init__ -rest_framework.relations.HyperlinkedRelatedField.__init__ rest_framework.relations.ManyRelatedField.__init__ rest_framework.relations.SlugRelatedField.__init__ -rest_framework.serializers.HyperlinkedIdentityField.__init__ -rest_framework.serializers.HyperlinkedRelatedField.__init__ rest_framework.serializers.ManyRelatedField.__init__ rest_framework.serializers.SlugRelatedField.__init__