def retrieve(self, request, pk=None, site_pk=None, *args, **kwargs):
        """Retrieve a single object optionally filtered by site."""
        # If the incoming pk has changed, store it in view kwargs. This is so
        # that nested routers and detail routes work properly such as when
        # calling ``GET /api/sites/1/networks/40/parent/``.
        if 'pk' in self.kwargs:
            self.kwargs['pk'] = pk
        if 'site_pk' in self.kwargs:
            self.kwargs['site_pk'] = site_pk

        obj = self.get_object()
        serializer = self.get_serializer(obj, *args, **kwargs)

        return self.success(serializer.data)
dataset/ETHPy150Open dropbox/nsot/nsot/api/views.py/BaseNsotViewSet.retrieve/original