0

I'm looking to add a new table that records all the user activity in my models. I was able to add a time stamp for general edits, but is there any practical way of adding a new table with the time stamp and the changed field? This would be useful to have as a ledger for all the user activity.

As an example: if i have a model named blog_post with fields of title and content, how would I back up a history of the changes into a master table with a timestamp and user_id so i could see all the different versions of that blog post with a time stamp and the content change?

  • take a look at https://stackoverflow.com/questions/3874199/how-to-store-historical-data – gogaz Aug 16 '18 at 19:44
  • You could define a custom method on your model which adds a new record of another logging model...on change or on update...? –  Aug 16 '18 at 20:21
  • There are many third party packages for audit logging. See https://djangopackages.org/grids/g/model-audit/ – Selcuk Aug 16 '18 at 23:06

0 Answers0