Reputation: 159
Using Django 1.9's Admin site, it is possible to view the change history for Model objects using the History button. When a change is made and logged in History, right now it only shows me the Action, for example "Changed description." is there a way to customize the fields in the History list to show the previous value of the field as well as what it was changed to? For example, "Changed x to y." Thank you!
Upvotes: 5
Views: 3311
Reputation: 2468
Django does keep a history of changes made. If you want to access that history in the django_admin_log this will be of use to you to add it to your own admin
http://djangoweekly.com/blog/post/viewbrowse-all-django-admin-edits-recent-actions-listing
Upvotes: 0
Reputation: 15084
Django-admin does not offer a full-featured auditing history of your models. Instead you have to rely to a app like django-reversion (https://github.com/etianen/django-reversion) or django-simple-history (https://github.com/treyhunner/django-simple-history). One difference between these is that django-reversion keeps a JSON object for each version of the file, while django-simple-history creates a seperate history table - so django-reversion has a more compact representation of each version while django-simple-history offers easier older version querying.
I've also written an introductionary article about django-model auditing that may be useful @ https://spapas.github.io/2015/01/21/django-model-auditing/
Upvotes: 4