Skip to content
Advertisement

Keep history in django to draw graphs

I am looking for the best way to have an history of my models (interger & float fields) in Django.
I read Keeping a history of data changes in database and it seems that triggers are the best option.

My idea is to stay database agnostic if possible.

How do you approach this issues in your django code ?

TIA.

Advertisement

Answer

You should check out Django Reversion app. It’s probably the easiest way to implement what you want in your project, especially if you’d also like to restore earlier versions of your model(s). If not, it might be a bit overkill.

Edit: You should also examine Django History. Might be more along the lines of what you really need. However it hasn’t been updated in a long time, you might have to just use it as inspiration for your custom solution.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement