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/assets/api/category.py

23 lines
530 B

from rest_framework.generics import ListAPIView
from assets.serializers import CategorySerializer, TypeSerializer
from assets.const import AllTypes
__all__ = ['CategoryListApi', 'TypeListApi']
class CategoryListApi(ListAPIView):
serializer_class = CategorySerializer
permission_classes = ()
def get_queryset(self):
return AllTypes.categories()
class TypeListApi(ListAPIView):
serializer_class = TypeSerializer
permission_classes = ()
def get_queryset(self):
return AllTypes.types()