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


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