forTestingModeration.py 924 Bytes
Newer Older
Florent Chehab's avatar
Florent Chehab committed
1
2
3
4
from django.db import models

from backend_app.utils import get_model_config, get_viewset_permissions

5
6
7
8
9
10
11
12
13
from .myModel import MyModel
from .myModelSerializer import MyModelSerializer
from .myModelViewSet import MyModelViewSet


class ForTestingModeration(MyModel):
    """
        Simple model for testing purposes
    """
14

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


class ForTestingModerationSerializer(MyModelSerializer):
    """
Florent Chehab's avatar
Florent Chehab committed
21
        Simple serializer for testing purpose
22
    """
23

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


class ForTestingModerationViewSet(MyModelViewSet):
    """
Florent Chehab's avatar
Florent Chehab committed
31
        Simple Viewset for testing purpose
32
    """
33

34
    permission_classes = get_viewset_permissions("ForTestingModerationViewSet")
35
36
    serializer_class = ForTestingModerationSerializer
    queryset = ForTestingModeration.objects.all()