Auto-populating created_by field with Django admin site

I really wanted a better solution than the ones I found elsewhere, so I wrote some middleware - implementation on the Populate user Id question. My solution requires no changes to any form or view.


http://code.djangoproject.com/wiki/CookBookNewformsAdminAndUser

Involves implementing save methods on your ModelAdmin objects.


You need to specify a default for the field, in this case a method call that gets the current user (see the auth documentation to get the current user).