首页 > 解决方案 > How to add a time stamp for all the fields in a model django

问题描述

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?

标签: djangodjango-models

解决方案


推荐阅读