myModel.py 872 Bytes
Newer Older
Florent Chehab's avatar
Florent Chehab committed
1
2
from django.db import models
from django.contrib.auth.models import User
3
# from rest_framework import serializers
Florent Chehab's avatar
Florent Chehab committed
4
5
6
7
8
9
10
11
12
13
14
15
16
# from backend.signals import new_revision_saved
# import reversion


class MyModel(models.Model):
    """
        All models in the app deppend of this one.
        It contains the required attributes for managing eventual moderation data.

        All the logic behind moderation is done in myModelSerializer
    """

    moderated_by = models.ForeignKey(
17
        User, null=True, on_delete=models.SET_NULL, related_name='+')
Florent Chehab's avatar
Florent Chehab committed
18
19
20
21
    moderated_on = models.DateTimeField(null=True)

    updated_on = models.DateTimeField(null=True)
    updated_by = models.ForeignKey(
22
        User, null=True, on_delete=models.SET_NULL, related_name='+')
Florent Chehab's avatar
Florent Chehab committed
23
24
25
26
27
28
29
30

    class Meta:
        abstract = True


# class MyModelVersionned(MyModel):
#     class Meta:
#         abstract = True