2020-07-06 03:14:20 +00:00
|
|
|
from rest_framework.viewsets import GenericViewSet, ModelViewSet
|
2020-07-29 06:57:44 +00:00
|
|
|
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 (
|
2021-07-08 06:23:18 +00:00
|
|
|
SerializerMixin, QuerySetMixin, ExtraFilterFieldsMixin, PaginatedResponseMixin,
|
|
|
|
RelationMixin, AllowBulkDestroyMixin, RenderToJsonMixin,
|
2020-07-09 07:41:02 +00:00
|
|
|
)
|
2020-07-06 03:14:20 +00:00
|
|
|
|
|
|
|
|
2021-07-08 06:23:18 +00:00
|
|
|
class CommonMixin(SerializerMixin,
|
2021-03-08 08:55:21 +00:00
|
|
|
QuerySetMixin,
|
|
|
|
ExtraFilterFieldsMixin,
|
|
|
|
PaginatedResponseMixin,
|
2021-03-08 08:55:21 +00:00
|
|
|
RenderToJsonMixin):
|
2021-03-08 08:55:21 +00:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class JmsGenericViewSet(CommonMixin,
|
2020-07-09 07:41:02 +00:00
|
|
|
GenericViewSet):
|
2020-07-06 03:14:20 +00:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
2021-03-08 08:55:21 +00:00
|
|
|
class JMSModelViewSet(CommonMixin,
|
2020-07-09 07:41:02 +00:00
|
|
|
ModelViewSet):
|
2020-07-06 03:14:20 +00:00
|
|
|
pass
|
2020-07-29 06:57:44 +00:00
|
|
|
|
|
|
|
|
2021-03-08 08:55:21 +00:00
|
|
|
class JMSBulkModelViewSet(CommonMixin,
|
2021-07-08 06:23:18 +00:00
|
|
|
AllowBulkDestroyMixin,
|
2020-07-29 06:57:44 +00:00
|
|
|
BulkModelViewSet):
|
|
|
|
pass
|
2020-08-03 08:17:46 +00:00
|
|
|
|
|
|
|
|
2021-03-08 08:55:21 +00:00
|
|
|
class JMSBulkRelationModelViewSet(CommonMixin,
|
2020-08-03 08:17:46 +00:00
|
|
|
RelationMixin,
|
2021-07-08 06:23:18 +00:00
|
|
|
AllowBulkDestroyMixin,
|
2020-08-03 08:17:46 +00:00
|
|
|
BulkModelViewSet):
|
|
|
|
pass
|