3 ms·
This extra table approach is how the django_simple_history[1] implements model history. Although it hooks into the Django ORM to save history rather than trigge
by Humphrey 3y ago
This extra table approach is how the django_simple_history[1] implements model history. Although it hooks into the Django ORM to save history rather than triggers. It's simple and brilliant, and I look it into any model that needs the ability to revert.
[1] https://django-simple-history.readthedocs.io/en/latest/ https://django-simple-history.readthedocs.io/en/latest/
- physicsguy 3y agoThere's also django-reversion, but I can't say I loved using it.
- emptysea 3y agoThe problem with Django simple history and similar is they use Django signals and aren’t transactional. So if you have any bulk updates or things that don’t trigger signals, your SOL, and your history starts missing things A more robust solution would use triggers or an ORM with more transactional guarantees (aka not using signals)