myModelViewSet.py 392 Bytes
Newer Older
1
from rest_framework import permissions
2
3
from .myModelSerializer import MyModelSerializer
from backend.models.tools import NoDeleteIfNotAdmin
4
from backend.models.tools import DictModeViewSet
5
6


7
class MyModelViewSet(DictModeViewSet):  # TODO switch to dict
8
9
10
11
12
    serializer_class = MyModelSerializer
    permission_classes = (
        permissions.IsAuthenticated,
        NoDeleteIfNotAdmin,
    )