jumpserver/apps/common/drf/api.py

39 lines
1023 B
Python
Raw Normal View History

2020-07-06 03:14:20 +00:00
from rest_framework.viewsets import GenericViewSet, ModelViewSet
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,
2020-07-09 07:41:02 +00:00
GenericViewSet):
2020-07-06 03:14:20 +00:00
pass
class JMSModelViewSet(CommonMixin,
2020-07-09 07:41:02 +00:00
ModelViewSet):
2020-07-06 03:14:20 +00:00
pass
class JMSBulkModelViewSet(CommonMixin,
AllowBulkDestroyMixin,
BulkModelViewSet):
pass
class JMSBulkRelationModelViewSet(CommonMixin,
RelationMixin,
AllowBulkDestroyMixin,
BulkModelViewSet):
pass