class RetrieveModelMixin

from rest_framework.mixins import RetrieveModelMixin
Documentation Source code
    Retrieve a model instance.
    Should be mixed in with `SingleObjectBaseView`.
    

Ancestors (MRO)

  1. RetrieveModelMixin

Methods used but not implemented in this class

  • get_object
  • get_serializer
Expand Collapse

Methods

def retrieve(self, request, *args, **kwargs): ΒΆ RetrieveModelMixin

    def retrieve(self, request, *args, **kwargs):
        self.object = self.get_object()
        serializer = self.get_serializer(self.object)
        return Response(serializer.data)