forTestingModeration.py 874 Bytes
Newer Older
1
2
3
4
from .myModel import MyModel
from .myModelSerializer import MyModelSerializer
from .myModelViewSet import MyModelViewSet
from django.db import models
Florent Chehab's avatar
Florent Chehab committed
5
from backend_app.utils import get_model_config, get_viewset_permissions
6
7
8
9
10
11


class ForTestingModeration(MyModel):
    """
        Simple model for testing purposes
    """
Florent Chehab's avatar
Florent Chehab committed
12
    model_config = get_model_config("ForTestingModeration")
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
    aaa = models.CharField(max_length=100)


class ForTestingModerationSerializer(MyModelSerializer):
    """
        Same as above
    """
    class Meta:
        model = ForTestingModeration
        fields = '__all__'


class ForTestingModerationViewSet(MyModelViewSet):
    """
        Same as above
    """
29
    permission_classes = get_viewset_permissions("ForTestingModerationViewSet")
30
31
    serializer_class = ForTestingModerationSerializer
    queryset = ForTestingModeration.objects.all()