How about this:
Set your model's user field so editable=False
Sub-class ModelAdmin
Override its `save_add` method, setting form.data['user'] =
request.user then calling the super method
--~--~-~--~~~---~--~~
You received this message because you are subscribed to t
I was reading this page
http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser
and was wondering how the advice on avoiding the hack applied to my
own use case.
I am using the ThreadLocals hack to get the current user in a model
when overriding the save() method. Therefore I can't pass i
2 matches
Mail list logo