jumpserver/apps/common/drf/api.py

43 lines
1.1 KiB
Python
Raw Normal View History

from rest_framework.viewsets import GenericViewSet, ModelViewSet, ReadOnlyModelViewSet, ViewSet
from rest_framework_bulk import BulkModelViewSet
2020-07-06 03:14:20 +00:00
2020-07-09 07:41:02 +00:00
from ..mixins.api import (
SerializerMixin, QuerySetMixin, ExtraFilterFieldsMixin, PaginatedResponseMixin,
RelationMixin, AllowBulkDestroyMixin, RenderToJsonMixin,
2020-07-09 07:41:02 +00:00
)
2020-07-06 03:14:20 +00:00
class CommonMixin(SerializerMixin,
QuerySetMixin,
ExtraFilterFieldsMixin,
PaginatedResponseMixin,
RenderToJsonMixin):
pass
class JMSGenericViewSet(CommonMixin, GenericViewSet):
2020-07-06 03:14:20 +00:00
pass
class JMSViewSet(CommonMixin, ViewSet):
2020-07-06 03:14:20 +00:00
pass
class JMSModelViewSet(CommonMixin, ModelViewSet):
pass
class JMSReadOnlyModelViewSet(CommonMixin, ReadOnlyModelViewSet):
pass
class JMSBulkModelViewSet(CommonMixin, AllowBulkDestroyMixin, BulkModelViewSet):
pass
class JMSBulkRelationModelViewSet(CommonMixin,
RelationMixin,
AllowBulkDestroyMixin,
BulkModelViewSet):
pass