Skip to content

Fix SlugRelatedField.to_representation() parameter name #632

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

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 @@ -159,7 +159,7 @@ class SlugRelatedField(RelatedField[_MT, str, str]):
style: dict[str, str] | None = ...,
) -> None: ...
def to_internal_value(self, data: Any) -> _MT: ...
def to_representation(self, value: _MT) -> str: ...
def to_representation(self, obj: _MT) -> str: ...

class ManyRelatedField(Field[Sequence[Any], Sequence[Any], list[Any], Any]):
default_empty_html: list[object]
Expand Down
2 changes: 0 additions & 2 deletions scripts/stubtest/allowlist_todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ rest_framework.parsers.BaseParser.media_type
rest_framework.parsers.FileUploadParser.get_encoded_filename
rest_framework.relations.ManyRelatedField.initial
rest_framework.relations.ManyRelatedField.to_representation
rest_framework.relations.SlugRelatedField.to_representation
rest_framework.renderers.BaseRenderer.format
rest_framework.renderers.BaseRenderer.media_type
rest_framework.renderers.BrowsableAPIRenderer.get_extra_actions
Expand Down Expand Up @@ -96,7 +95,6 @@ rest_framework.serializers.NotFound
rest_framework.serializers.NullBooleanField
rest_framework.serializers.ParseError
rest_framework.serializers.PermissionDenied
rest_framework.serializers.SlugRelatedField.to_representation
rest_framework.serializers.Throttled
rest_framework.serializers.TimeField.to_internal_value
rest_framework.serializers.UnsupportedMediaType
Expand Down