Tuesday, April 27, 2010

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

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 signals that are available. My code
will log all changes to models unless the model is included in a
DONT_LOG_MODELS tuple in the app settings. Changes to m2m
relationships are stored against the model containing the m2m.

Hope this helps.

Cheers,
Tony

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate