API of Serializer and ViewSet in restframework
· ☕ 4 min read
1. Serializer 1.1 Data Validation When deserializing data, the validity of the data needs to be checked. At this point you can call is_valid() for validation, and if a validation error occurs, you can get the error message from the .errors attribute. For example:
1 2 3 4 serializer.is_valid() # False serializer.