3

What I'm trying to do is get a record of all the fields that may have changed after a object has changed. I know there are many ways to tell if an object has changed as well as some other django packages like django-revisions, django-reversion, and django-simple-history but I want to be able to have a report that shows all of the field that have changed, not just one. I also what to show what the field was before it was changed so I can have a complete audit on the object.

I was thinking of adding a json field with django-jsonfield but felt kind of wrong to do it like this. As if it was a hack or dirty work around. Is there a more traditional or simpler way to do this.

Austin
  • 4,296
  • 6
  • 40
  • 52
  • this is similar to http://stackoverflow.com/questions/110803/dirty-fields-in-django and to http://stackoverflow.com/questions/1141484/can-you-find-out-if-a-django-model-instance-is-dirty – dnozay Apr 23 '13 at 17:06

1 Answers1

3

You might take a look at django-dirtyfields. When an object is updated, you could get a list of all of the fields that are dirty and generate the report you need. It won't do this automatically, but it would get you the fields that have been changed.

Brandon Taylor
  • 33,823
  • 15
  • 104
  • 144
  • This seems to be exactly what I was looking for. Nice and light weight and very easy to implement. Have already started making my reports. Thank you! – Austin Mar 20 '13 at 12:59