def serialize(self, **extra_context): context = { 'request': self.request, 'view': self.view, } context.update(extra_context) serializer = ReviewSerializer(context=context) return serializer.to_representation(self.review)
def serialize(self): serializer = ReviewSerializer(context={'request': self.request}) return serializer.to_representation(self.review)