request.user.username (or probably better, use a foreign key reference to User in the record you are saving and say something like:
product.created_by = request.user Only the id of the user record will be saved, but you can access any user information anytime you look at the record, e.g.; product.created_by.email On Mon, Nov 14, 2011 at 10:55 AM, chronosx7 <abdak...@gmail.com> wrote: > Hi, this is the order of events I am trying to solve: > > An user gets authenticated with the Admin of dJango > Enters an option to add new products to the database > It is needed to automatically save the user who added the product to > the database > That is why I was thinking it would be best to override the Save > method to get the authenticated user, which is what I am trying to do > but I am not really sure how... > > Does anyone know how to do it? > > Thanks for your help. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.