[Answered ]-From django rest framework 3 pre_save, pre_delete is not available than how to manipulate and insert requested user name in any field?

2👍

You can use perfom_create and perform_update in your views

The pre_save and post_save hooks no longer exist, but are replaced
with perform_create(self, serializer) and perform_update(self,
serializer).

These methods should save the object instance by calling
serializer.save(), adding in any additional arguments as required.
They may also perform any custom pre-save or post-save behavior.

Example

def perform_create(self, serializer):
    # Include the owner attribute directly, rather than from request data.
    instance = serializer.save(owner=self.request.user)
    # Perform a custom post-save action.
    send_email(instance.to_email, instance.message)
👤levi

Leave a comment