You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jumpserver/apps/ops/api/adhoc.py

23 lines
418 B

# -*- coding: utf-8 -*-
#
from rest_framework import viewsets
from ..models import AdHoc
from ..serializers import (
AdHocSerializer, AdhocListSerializer,
)
__all__ = [
'AdHocViewSet'
]
class AdHocViewSet(viewsets.ModelViewSet):
queryset = AdHoc.objects.all()
def get_serializer_class(self):
if self.action != 'list':
return AdhocListSerializer
return AdHocSerializer