def destroy(self, request, *args, **kwargs): instance = self.get_object() instance.is_deleted = True instance.save() serializer = MovieSerializer(instance) return Response(serializer.data)
def viewed(self, request, *args, **kwargs): instance = self.get_object() instance.viewed = request.data.get('viewed', True) instance.save() serializer = MovieSerializer(instance) return Response(serializer.data)
def retrieve(self, request, *args, **kwargs): instance = self.get_object() serializer = MovieSerializer(instance) return Response(serializer.data)