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/asset/device.py

16 lines
420 B

from assets.serializers import DeviceSerializer
from assets.models import Device, Asset
from .asset import AssetViewSet
__all__ = ['DeviceViewSet']
class DeviceViewSet(AssetViewSet):
model = Device
perm_model = Asset
def get_serializer_classes(self):
serializer_classes = super().get_serializer_classes()
serializer_classes['default'] = DeviceSerializer
return serializer_classes