Skip to content

Commit

Permalink
[3.15] Move fields.set_value to Serializer.set_value (#576)
Browse files Browse the repository at this point in the history
  • Loading branch information
JaeHyuckSa authored Apr 14, 2024
1 parent ca47a6f commit 7f7094f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions rest_framework-stubs/fields.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import datetime
import uuid
from _typeshed import Incomplete
from collections.abc import Callable, Generator, Iterable, Mapping, MutableMapping, Sequence
from collections.abc import Callable, Generator, Iterable, Mapping, Sequence
from decimal import Decimal
from enum import Enum
from json import JSONDecoder, JSONEncoder
Expand Down Expand Up @@ -44,7 +44,6 @@ class Option(Protocol):

def is_simple_callable(obj: Callable) -> bool: ...
def get_attribute(instance: Any, attrs: list[str] | None) -> Any: ...
def set_value(dictionary: MutableMapping[str, Any], keys: Sequence[str], value: Any) -> None: ...
def to_choices_dict(choices: Iterable[Any]) -> dict: ...
def flatten_choices_dict(choices: dict[Any, Any]) -> dict: ...
def iter_options(
Expand Down
1 change: 1 addition & 0 deletions rest_framework-stubs/serializers.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class Serializer(
_declared_fields: dict[str, Field]
default_error_messages: ClassVar[dict[str, StrOrPromise]]
def get_initial(self) -> Any: ...
def set_value(self, dictionary: MutableMapping[str, Any], keys: Sequence[str], value: Any) -> None: ...
@cached_property
def fields(self) -> BindingDict: ...
def get_fields(self) -> dict[str, Field]: ...
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 @@ -143,7 +143,6 @@ rest_framework.compat.distinct
rest_framework.fields.DecimalField.__init__
rest_framework.fields.Field.__class_getitem__
rest_framework.fields.logger
rest_framework.fields.set_value
rest_framework.filters.search_smart_split
rest_framework.generics.GenericAPIView.__class_getitem__
rest_framework.request.Request.__class_getitem__
Expand All @@ -154,7 +153,6 @@ rest_framework.serializers.Field.__class_getitem__
rest_framework.serializers.LIST_SERIALIZER_KWARGS_REMOVE
rest_framework.serializers.ListSerializer.run_child_validation
rest_framework.serializers.ModelSerializer.get_unique_together_constraints
rest_framework.serializers.Serializer.set_value
rest_framework.templatetags.rest_framework.optional_logout
rest_framework.utils.encoders.CustomScalar
rest_framework.utils.field_mapping.get_unique_validators

0 comments on commit 7f7094f

Please sign in to comment.