How to auto insert the current user when creating an object in django admin?

Posted by FurtiveFelon on Stack Overflow See other posts from Stack Overflow or by FurtiveFelon
Published on 2010-06-07T16:40:04Z Indexed on 2010/06/07 16:42 UTC
Read the original article Hit count: 197

Filed under:
|

Hi all,

I have a database of articles with a

submitter = models.ForeignKey(User, editable=False)

Where User is imported as follows:

from django.contrib.auth.models import User. 

I would like to auto insert the current active user to the submitter field when a particular user submits the article.

Anyone have any suggestions?

© Stack Overflow or respective owner

Related posts about django

Related posts about django-admin