Does the @action decorator only work for viewsets.ModelViewSets?
Can I use the @action decorator for say a generics.RetrieveAPI?
If so, how? E.g. the following doesn't work:
class ItemDetailView(generics.RetrieveAPI):
queryset = Item.objects.all()
serializer_class = ItemDetailSerializer
@action(detail=True, methods=["get"])
def custom(self, request, pk=None):
# Do whatever custom action
return Response(status=status.HTTP_200_OK)