loadGeneric.py 360 Bytes
Newer Older
Florent Chehab's avatar
Florent Chehab committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
from django.utils import timezone
import reversion


class LoadGeneric(object):

    @classmethod
    def add_info(cls, obj, admin):
        with reversion.create_revision():
            obj.moderated_by = admin
            obj.updated_by = admin
            obj.moderated_on = timezone.now()
            obj.updated_on = timezone.now()
            obj.save()