feat(ops): Task 支持批量操作

This commit is contained in:
xinwen
2020-11-04 14:53:49 +08:00
committed by 老广
parent 231332585d
commit 2b4f8bd11c
3 changed files with 9 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ from django.shortcuts import get_object_or_404
from rest_framework import viewsets, generics
from rest_framework.views import Response
from common.drf.api import JMSBulkModelViewSet
from common.permissions import IsOrgAdmin
from common.serializers import CeleryTaskSerializer
from ..models import Task, AdHoc, AdHocExecution
@@ -22,7 +23,7 @@ __all__ = [
]
class TaskViewSet(viewsets.ModelViewSet):
class TaskViewSet(JMSBulkModelViewSet):
queryset = Task.objects.all()
filter_fields = ("name",)
search_fields = filter_fields