Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

drf serializer

serializer = CommentSerializer(data={'email': 'foobar', 'content': 'baz'})
serializer.is_valid()
# False
serializer.errors
# {'email': ['Enter a valid e-mail address.'], 'created': ['This field is required.']}
Source by www.django-rest-framework.org #
 
PREVIOUS NEXT
Tagged: #drf #serializer
ADD COMMENT
Topic
Name
9+8 =