loadGeneric.py 369 Bytes
Newer Older
Florent Chehab's avatar
Florent Chehab committed
1
2
3
4
5
6
7
from django.utils import timezone
import reversion


class LoadGeneric(object):

    @classmethod
8
    def add_info_and_save(cls, obj, admin):
Florent Chehab's avatar
Florent Chehab committed
9
10
11
12
13
14
        with reversion.create_revision():
            obj.moderated_by = admin
            obj.updated_by = admin
            obj.moderated_on = timezone.now()
            obj.updated_on = timezone.now()
            obj.save()