I have a model Question with a field called userid, before one ask a question, one needs to login, i want when saving to capture the user ID of the currently logged-in user and assign it to the userid of the Question model.
Please note am not showing the userid on my form i.e. in the Question model i have declared the userid as follows;
class Question(models.Model): ... userid=models.ForeignKey(User, editable=false) ...
How do i assign logged-in user ID to the Question model userid?