Example #1
0
 def destroy(self, request, *args, **kwargs):
     instance = self.get_object()
     instance.is_deleted = True
     instance.save()
     serializer = MovieSerializer(instance)
     return Response(serializer.data)
Example #2
0
 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)
Example #3
0
 def retrieve(self, request, *args, **kwargs):
     instance = self.get_object()
     serializer = MovieSerializer(instance)
     return Response(serializer.data)