Very simple requirement:
Every time a post_save signal fires, I want to store the values of the
model instance, along with the timestamp and the user who made the
change.
Considering that this also applies to models from pluggable and
otherwise reusable applications, it is not even sane to go and modify
all the save() methods of the models and every view that uses those
models. I'm looking for a way to store this information for auditing
purposes.
Is this possible in Django? If the answer is 'no,' then it's 'no.' But
so far I haven't heard that this is impossible, just that attempting
it is somehow morally wrong.
Shawn
No, but there's lots of other solutions. Marty Alchin solves this nicely with CurrentUserMiddleware:
I've been wanting to make this into a reusable app for a long time, but the license on that code snippet is unclear.
--
Andy McKay, @clearwind