开发者

Tracking changes to Django Model instances

开发者 https://www.devze.com 2022-12-21 01:34 出处:网络
When you create or modify an object instance in Django\'s admin, a changelog entry is created. This is really nice for fairly obvious reasons开发者_如何转开发.

When you create or modify an object instance in Django's admin, a changelog entry is created. This is really nice for fairly obvious reasons开发者_如何转开发.

However my model's instances created by a normal user outside of the admin interface. No changelog is recorded to note its creation (not a huge issue) but I would like to track edits the user makes.

I also want to show the user this full log (user+admin edits) in the frontend so I need a way to pull the changelog out.

My question: how? Is there a one-line switch I can flick to enable full logging or do I have to dig in and do something on my user's edit form logic?


django-reversion is an app designed to help with that.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号