Default value for user ForeignKey with Django admin

author = models.ForeignKey(User)

Is there any way I can set the default value of this field to automatically select the logged in user? I know you can do this in the save method but my client has requested that it automatically defaults to the logged in user at edit time to avoid confusion.

This article goes into how to update it during save, just not at edit time.

19
задан juliomalegria 17 January 2012 в 23:26
поделиться