jumpserver/apps/assets/api/asset/device.py

16 lines
420 B
Python
Raw Normal View History

2022-10-20 12:06:58 +00:00
from assets.serializers import DeviceSerializer
from assets.models import Device, Asset
2022-08-23 02:23:48 +00:00
from .asset import AssetViewSet
2022-09-15 13:20:56 +00:00
__all__ = ['DeviceViewSet']
2022-08-23 02:23:48 +00:00
2022-09-15 13:20:56 +00:00
class DeviceViewSet(AssetViewSet):
model = Device
perm_model = Asset
2022-08-23 02:23:48 +00:00
def get_serializer_classes(self):
serializer_classes = super().get_serializer_classes()
2022-10-20 12:06:58 +00:00
serializer_classes['default'] = DeviceSerializer
2022-08-23 02:23:48 +00:00
return serializer_classes