0

Below code calls the retrieve method and works fine

class SomeWorkflow(ViewSet):
    serializer_class = SomeWorkflowSerializer

    def retrieve(self, request, pk):
        response = OtherWorkflow.as_view({'get': 'retrieve'})(request._request, 'some_id').data

Now I want to call the OtherWorkflowSerializer class's create method. The create method also takes some parameters like {'id': 1, 'file_path': '/foo/bar/file.txt'}

  • Could you add a little more context? Why would you want to create something from a GET request? – gdef_ Feb 26 '20 at 12:25
  • There are four to five classes and I want to call them via loop to automate the functionality, also it is not necessary to use GET, I can use POST request also to call other POST methods of the classes. It can be either way. – Akshay Sharma Feb 26 '20 at 13:43

0 Answers0