2020-10-19 12:13:01 +00:00
|
|
|
# coding: utf-8
|
|
|
|
#
|
|
|
|
|
|
|
|
from orgs.mixins.api import OrgBulkModelViewSet
|
|
|
|
|
2021-06-11 03:05:40 +00:00
|
|
|
from ..hands import IsOrgAdminOrAppUser
|
|
|
|
from .. import serializers
|
2021-05-24 11:11:47 +00:00
|
|
|
from ..models import Application
|
2020-10-19 12:13:01 +00:00
|
|
|
|
|
|
|
|
2021-06-11 03:05:40 +00:00
|
|
|
__all__ = ['ApplicationViewSet']
|
2020-10-19 12:13:01 +00:00
|
|
|
|
2021-01-03 21:27:03 +00:00
|
|
|
|
2021-01-05 15:39:38 +00:00
|
|
|
class ApplicationViewSet(OrgBulkModelViewSet):
|
2021-05-24 11:11:47 +00:00
|
|
|
model = Application
|
2021-01-07 02:53:10 +00:00
|
|
|
filterset_fields = ('name', 'type', 'category')
|
|
|
|
search_fields = filterset_fields
|
2020-10-19 12:13:01 +00:00
|
|
|
permission_classes = (IsOrgAdminOrAppUser,)
|
|
|
|
serializer_class = serializers.ApplicationSerializer
|