Re: Get current user ID in _pre_save() function

2006-03-27 Thread bruno desthuilliers
Gacha wrote: > I created a simple model "articles" and I added field: > author= meta.ForeignKey(User,editable=False) > > When I add new artcicle I want to assign to this field the current user > ID, but so far no luck :( > > I tryed: > def _pre_save(self): > from django.models.auth.u

Re: Get current user ID in _pre_save() function

2006-03-26 Thread Gacha
I solved this problem by this patch: http://code.djangoproject.com/attachment/ticket/1132/current_user_field_patch.2.diff Now I use: author = meta.CurrentUserField(update_on_edit=False) -- But the problem about User management is not solved :( --~--~-~--~~-

Get current user ID in _pre_save() function

2006-03-25 Thread Gacha
I created a simple model "articles" and I added field: author = meta.ForeignKey(User,editable=False) When I add new artcicle I want to assign to this field the current user ID, but so far no luck :( I tryed: def _pre_save(self): from django.models.auth.users import User self.author = Us