![]() ![]() If the data is invalid, errors are then appended to the serializer's error property and a ValidationError is thrown. Custom Data ValidationÄRF enforces data validation in the deserialization process, which is why you need to call is_valid() before accessing the validated data. I recommend reading the article as a whole but feel free to hone in on the concept(s) that you're specifically interested in. to provide any custom init argument to a list serializer without overriding the manyinit method: django-rest-framework/restframework/serializers.py. ![]() The concepts presented in this article are not connected with one another. Creating separate read and write serializers.Attaching data to the serialized output.Attaching serializer function responses to data.Customizing the serialization and deserialization output.Validating data at the field or object level.Attach serializer function response to data. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |