djangosnippets.org: Latest snippets tagged with 'tracking'https://djangosnippets.org/tags/tracking/2011-01-08T05:43:53.760729-06:00Memento
2011-01-08T05:43:53.760729-06:00manelvfhttps://djangosnippets.org/snippets/2315/<p>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.
</p>
<p>Example of code for a model in <strong>admin.py</strong> for a custom 'app':
</p>
<pre><code>from app.memento.models import Memento
def save_model(self, request, obj, form, change):
obj.save()
data = …</code></pre>
Freely redistributable