class DestroyModelMixin

from rest_framework.mixins import DestroyModelMixin
Documentation Source code
    Destroy a model instance.
    Should be mixed in with `SingleObjectAPIView`.
    

Ancestors (MRO)

  1. DestroyModelMixin

Methods used but not implemented in this class

  • get_object
Expand Collapse

Methods

def destroy(self, request, *args, **kwargs): ΒΆ DestroyModelMixin

    def destroy(self, request, *args, **kwargs):
        obj = self.get_object()
        obj.delete()
        return Response(status=status.HTTP_204_NO_CONTENT)