forTestingVersionning.py 814 Bytes
Newer Older
Florent Chehab's avatar
Florent Chehab committed
1
2
3
4
5
6
7
8
9
10
11
12
from .myModelVersionned import MyModelVersionned, MyModelVersionnedSerializer, MyModelVersionnedViewSet
from django.db import models
import reversion


@reversion.register()
class ForTestingVersionning(MyModelVersionned):
    """
        Simple model for testing purposes
    """
    bbb = models.CharField(max_length=100)

13
14
    @classmethod
    def get_serializer(cls):
15
16
        return ForTestingVersionningSerializer

Florent Chehab's avatar
Florent Chehab committed
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

class ForTestingVersionningSerializer(MyModelVersionnedSerializer):
    """
        Same as above
    """
    class Meta:
        model = ForTestingVersionning
        fields = '__all__'


class ForTestingVersionningViewSet(MyModelVersionnedViewSet):
    """
        Same as above
    """
    serializer_class = ForTestingVersionningSerializer
    queryset = ForTestingVersionning.objects.all()