Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make HyperlinkedRelatedField(view_name=) & HyperlinkedIdentityField(view_name=) param optional #530

Merged
merged 4 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rest_framework-stubs/relations.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ...,
Expand Down
4 changes: 0 additions & 4 deletions scripts/stubtest/allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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__

Expand Down