if serializer is_valid name serializer object name if serializer is_va

1
2
3
4
5
6
if serializer.is_valid():
name = serializer.object.name
if serializer.is_valid():
name = serializer.validated_data['name']