This class tracks changes in Django Admin. When a save action is performed, it stores the value of the old object using the Memento model.

Example of code for a model in admin.py for a custom 'app':

from app.memento.models import Memento def save_model(self, request, obj, form, change): obj.save() data = serializers.serialize("json", [obj, ]) m = Memento(app="Unidade",model=modelName,data=data, user=request.user) m.save() class UnidadeAdmin(admin.ModelAdmin): pass UnidadeAdmin.save_model = save_model

This stores the former values of 'Unidade' model on 'Memento' model data.

Not tested on previous versions of Django, but could work on them too.