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

16 lines
387 B
Python
Raw Normal View History

2022-08-23 02:23:48 +00:00
from assets.serializers import HostSerializer
2022-09-15 13:20:56 +00:00
from assets.models import Device
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
2022-08-23 02:23:48 +00:00
def get_serializer_classes(self):
serializer_classes = super().get_serializer_classes()
serializer_classes['default'] = HostSerializer
return serializer_classes