class DestroyModelMixin

from rest_framework.mixins import DestroyModelMixin
Documentation Source code
    Destroy a model instance.
    

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):
        instance = self.get_object()
        self.perform_destroy(instance)
        return Response(status=status.HTTP_204_NO_CONTENT)

def perform_destroy(self, instance): DestroyModelMixin

    def perform_destroy(self, instance):
        instance.delete()