xxxxxxxxxx
# The purpose of the perform_create method is to customize the behavior
# of object creation when using the CreateModelMixin with a view or
# viewset. When a client sends a POST request to create a new object
# through the view, the perform_create method is called.
def perform_create(self, serializer):
serializer.save(author=self.request.user)