I have spent way too much time trying to figure out how to automatically have
modified_by be foreign keys to the current user, without mucking with every view and form. Every example I could find that told me how to do this, including django’s documentation itself, told me I had to customise every view and form, which I found to be rather un-DRY.
stealing borrowing some code from django-audit-log (in order to be threadsafe) I figured out how to update these values on any model that has them, without any fiddling with forms or views. I might wrap this up in a little project, but for now, here’s the gist.
Note that you should set
editable=False on your
modified_by fields so that they will not otherwise show up in forms.
If anyone is really interested i could wrap this in a self-installable package.