Skip to content

Instantly share code, notes, and snippets.

@jangjichang
Last active April 13, 2022 04:59
Show Gist options
  • Select an option

  • Save jangjichang/34f6d833edc19aceaf7a7e43a2670fc2 to your computer and use it in GitHub Desktop.

Select an option

Save jangjichang/34f6d833edc19aceaf7a7e43a2670fc2 to your computer and use it in GitHub Desktop.
class BaseSerializer(Field):
"""
The BaseSerializer class provides a minimal class which may be used
for writing custom serializer implementations.
Note that we strongly restrict the ordering of operations/properties
that may be used on the serializer in order to enforce correct usage.
BaseSerializer 클래스는 커스텀시리얼라이저 구현 작성에 사용할 수 있는 최소한의 클래스를 제공합니다.
올바른 사용을 강제하기 위해 시리얼라이저에서 사용할 수 있는 operations/properties의 순서를 엄격하게 제한하고 있습니다.
In particular, if a `data=` argument is passed then:
.is_valid() - Available.
.initial_data - Available.
.validated_data - Only available after calling `is_valid()`
.errors - Only available after calling `is_valid()`
.data - Only available after calling `is_valid()`
If a `data=` argument is not passed then:
.is_valid() - Not available.
.initial_data - Not available.
.validated_data - Not available.
.errors - Not available.
.data - Available.˙
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment