Don’t forget to share it with your network!
Mayur Rajeshkumar Ariwala
Tech Lead, Softices
Web Development
04 April, 2022
Mayur Rajeshkumar Ariwala
Tech Lead, Softices
Model history tracking is a feature which tracks the changes in model object, it tracks things like what change you made in it and when you deleted it. It also helps in the recovery of deleted object of model.
django-old-new-history is customize history feature which is used to show the old and new value of model's change field in history action of admin panel.
Just use: ::
pip install django-old-new-history
Add django_old_new_history to INSTALLED_APPS in your settings.py, e.g.: ::
INSTALLED_APPS = [
...
'django_old_new_history',
...
Inherit from DjangoOldNewHistory to get the custom history feature. admin.py e.g.: ::
from django.contrib import admin
from .models import ExampleModel
from django_old_new_history.admin import DjangoOldNewHistory
@admin.register(ExampleModel)
class ExampleModelAdmin(DjangoOldNewHistory, admin.ModelAdmin):
...
Here is screenshot of django-old-new-history