myModel.py 681 Bytes
Newer Older
Florent Chehab's avatar
Florent Chehab committed
1
2
3
4
5
6
7
8
9
10
11
12
13
from django.db import models
from django.contrib.auth.models import User


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(
14
        User, null=True, on_delete=models.SET_NULL, related_name='+')
Florent Chehab's avatar
Florent Chehab committed
15
16
17
18
    moderated_on = models.DateTimeField(null=True)

    updated_on = models.DateTimeField(null=True)
    updated_by = models.ForeignKey(
19
        User, null=True, on_delete=models.SET_NULL, related_name='+')
Florent Chehab's avatar
Florent Chehab committed
20
21
22

    class Meta:
        abstract = True