forTestingModeration.py 877 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
    """
12

Florent Chehab's avatar
Florent Chehab committed
13
    model_config = get_model_config("ForTestingModeration")
14
15
16
17
18
19
20
    aaa = models.CharField(max_length=100)


class ForTestingModerationSerializer(MyModelSerializer):
    """
        Same as above
    """
21

22
23
    class Meta:
        model = ForTestingModeration
24
        fields = "__all__"
25
26
27
28
29
30


class ForTestingModerationViewSet(MyModelViewSet):
    """
        Same as above
    """
31

32
    permission_classes = get_viewset_permissions("ForTestingModerationViewSet")
33
34
    serializer_class = ForTestingModerationSerializer
    queryset = ForTestingModeration.objects.all()