I've searched stack overflow and the internet for a solution to call a django restframework ListAPIView from anotehr django restframework APIView.
I've tried:
class ViewA(APIView):
def get(request):
response = ViewB.as_view({'get':'list'})(request)
print response.render()
# do other things with the response
However, I get the error:
response = SubsidiariesStatisticsView.as_view({'get': 'list'})(request)
TypeError: as_view() takes exactly 1 argument (2 given)
How do I pass in a request from viewA to viewB and get a response?
Also, class ViewB has a get_serializer_context method. How do I call that from ViewA?