I want to set the default value of my forms ‘author’ field (models.ForeignKey(User)) to the currently logged in user. I want to do this before the entry is saved so when creating an entry the user does not have to select themselves in order for the form to validate.
I tried setting the value in my form init function, but there is not reference to the request object so it seems impossible?
I am not using the django admin panel for this application.
Dynamic initial values worked for me, for a default Django form view:
This sets the initial value in the author drop-down for an unbound form, the user could still change it whilst editing.