(self, obj, data)
Validate and update given fields on object.
Validate and update given fields on object.
Validate and update given fields on object .
def simple_update(self, obj, data):
        """
            Validate and update given fields on object.
        """
        serializer = self.serializer_class(obj, data=data, partial=True, context={'request': self.request})
        if serializer.is_valid():
            serializer.save()
            return Response(serializer.data)
        raise ValidationError(serializer.errors)
def simple_update ( self , obj , data ) : serializer = self . serializer_class ( obj , data = data , partial = True , context = { 'request' : self . request } ) if serializer . is_valid ( ) : serializer . save ( ) return Response ( serializer . data ) raise ValidationError ( serializer . errors )