I'm trying to get the current loggedin user's username as a CharField in my model so I can track all the reviews from one user later on. But I'm not understanding how to do it. I don't understand this answer. How does the init function insert the users name into his model?
forms.py:
class ReviewForm(forms.ModelForm):
user_name = forms.CharField( GET THE CURRENT USERS USERNAME HERE )
burger = forms.CharField(max_length=150, help_text="What type of burger was it?")
class Meta:
model = Review
fields = ('place', 'burger',)