class PostReadOnlyViewSet(ActivityLogMixin, ReadOnlyModelViewSet):
queryset = Post.objects.all()
serializer_class = PostSerializer
def get_log_message(self, request) -> str:
return f"{request.user} is reading blog posts"
Actual work is done in this mixin.