Re: Track "before" and "after" state of an object when editing in the Admin?

2010-04-28 Thread Euan Goddard
Hi Derek, > How and where can this be done? I've recently been developing a project that uses MongoDB to audit Django models. I've just published an early version of this work on launchpad: https://launchpad.net/django-audit/ I haven't got around to writing any documentation yet, but if you're

Re: Track "before" and "after" state of an object when editing in the Admin?

2010-04-28 Thread derek
Nick & Tony - many thanks! Derek -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For

Re: Track "before" and "after" state of an object when editing in the Admin?

2010-04-27 Thread Tony Czeh
I had a very similar problem where I needed to track all changes to models throughout the entire application. I've posted my solution at http://pastebin.com/2Wc4Nwcd for you to take a look at. Basically, as was previously suggested, I've hooked into the various pre_*, post_* and m2m_changed

Re: Track "before" and "after" state of an object when editing in the Admin?

2010-04-26 Thread Nick Serra
There are a couple ways to do this. You can either override the model methods like save and init, or you can use signals and tie into the pre_save, post_save, etc. Signals are here: http://docs.djangoproject.com/en/dev/ref/signals/ If using signals, you will have an instance of the object being

Track "before" and "after" state of an object when editing in the Admin?

2010-04-26 Thread Derek
The Django docs point to the "hooks" you can use for custom code when saving/deleting objects in the Django admin http://www.djangoproject.com/documentation/models/save_delete_hooks/ What is not clear is how (or rather, where) to create a copy of an object before editing, so that it can be