I have a following model:
class Question(models.Model):
section = models.ForeignKey(Section)
description = models.TextField()
answer = models.TextField(blank=True, null=True)
author = models.ForeignKey(settings.AUTH_USER_MODEL)
Corresponding form is
class QuestionForm(forms.ModelForm):
class Meta:
model = Question
fields = ('description', 'section', 'author')
My question is how can I pass to the form value of author? Author is currently logged user (request.user is not accessible).
Thank you.