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

import reversion

5
6
7
8
from backend_app.models.abstract.versionedEssentialModule import (
    VersionedEssentialModule,
    VersionedEssentialModuleSerializer,
    VersionedEssentialModuleViewSet,
9
)
Florent Chehab's avatar
Florent Chehab committed
10
11
12


@reversion.register()
13
class ForTestingVersioning(VersionedEssentialModule):
Florent Chehab's avatar
Florent Chehab committed
14
    """
Florent Chehab's avatar
Florent Chehab committed
15
        Simple model for testing purposes (versioning)
Florent Chehab's avatar
Florent Chehab committed
16
    """
17

Florent Chehab's avatar
Florent Chehab committed
18
19
20
    bbb = models.CharField(max_length=100)


21
class ForTestingVersioningSerializer(VersionedEssentialModuleSerializer):
Florent Chehab's avatar
Florent Chehab committed
22
    """
Florent Chehab's avatar
Florent Chehab committed
23
        Simple Serializer for testing purposes (versioning)
Florent Chehab's avatar
Florent Chehab committed
24
    """
25

Florent Chehab's avatar
Florent Chehab committed
26
    class Meta:
27
        model = ForTestingVersioning
28
        fields = "__all__"
Florent Chehab's avatar
Florent Chehab committed
29
30


31
class ForTestingVersioningViewSet(VersionedEssentialModuleViewSet):
Florent Chehab's avatar
Florent Chehab committed
32
    """
Florent Chehab's avatar
Florent Chehab committed
33
        Simple Viewset for testing purposes (versioning)
Florent Chehab's avatar
Florent Chehab committed
34
    """
35

36
37
    serializer_class = ForTestingVersioningSerializer
    queryset = ForTestingVersioning.objects.all()