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

21 lines
539 B
Python
Raw Normal View History

2022-04-29 10:28:12 +00:00
from assets.models import Database
from assets.serializers import DatabaseSerializer
from .common import AssetViewSet
__all__ = ['DatabaseViewSet']
class DatabaseViewSet(AssetViewSet):
model = Database
def get_queryset(self):
queryset = super().get_queryset()
print("Datbase is: ", queryset)
return queryset
def get_serializer_classes(self):
serializer_classes = super().get_serializer_classes()
serializer_classes['default'] = DatabaseSerializer
return serializer_classes