class RetrieveModelMixin
from rest_framework.mixins import RetrieveModelMixin
Documentation
Source code
Retrieve a model instance.
Ancestors (MRO)
- RetrieveModelMixin
Methods used but not implemented in this class
- get_object
- get_serializer
Methods
def
retrieve(self, request, *args, **kwargs):
ΒΆ
RetrieveModelMixin
def retrieve(self, request, *args, **kwargs):
instance = self.get_object()
serializer = self.get_serializer(instance)
return Response(serializer.data)