@@ -29,23 +29,6 @@ def get_template_names(self):
2929 return names
3030
3131
32- class StartWorkflowMixin :
33- """
34- View-mixin to create a start workflow.
35-
36- Example:
37- class MyStartWorkflowView(StartWorkflowMixin, TaskViewMixin, View):
38- def post(self, request, *args, **kwargs):
39- try:
40- data = json.loads(request.body)
41- workflow_id = self.start_workflow(data)
42- except Exception as e:
43- return HttpResponseBadRequest("Failed to start workflow")
44-
45- return JsonResponse({'message': 'Workflow started successfully.', 'id': workflow_id}, status=201)
46- """
47-
48-
4932class TaskViewMixin (WorkflowTemplateNameViewMixin , RevisionMixin ):
5033 name = None
5134 path = ""
@@ -114,6 +97,25 @@ def create_task(self, workflow, prev_task):
11497 )
11598
11699
100+ class StartViewMixin (TaskViewMixin ):
101+ """
102+ View-mixin to create a start workflow.
103+
104+ Example:
105+ class MyStartWorkflowView(StartViewMixin, View):
106+ def post(self, request, *args, **kwargs):
107+ try:
108+ data = json.loads(request.body)
109+ workflow_id = self.start_workflow(data)
110+ except Exception as e:
111+ return HttpResponseBadRequest("Failed to start workflow")
112+
113+ return JsonResponse({'message': 'Workflow started successfully.', 'id': workflow_id}, status=201)
114+ """
115+
116+ model = None
117+
118+
117119class WorkflowDetailView (WorkflowTemplateNameViewMixin , generic .DetailView ):
118120 pass
119121
0 commit comments