title: django class-based view - UpdateView - How to access the request user while processing a form?
body: <p>In a class-base UpdateView in Django, I exclude the user field as it is internal to the system and I won't ask for it. Now what is the proper Django way of passing the user into the form.
  (How I do it now, is I pass the user into the <strong>init</strong> of the form and then override the form's save() method. But I bet that there is a proper way of doing this. Something like a hidden field or things of that nature. </p>
  
  <pre><code># models.py
  class Entry(models.Model):
      user = models.ForeignKey(
                  User,
                  related_name="%(class)s",
                  null=False
      )
  
      name = models.CharField(
                  blank=False, 
                  max_length=58,
      )
  
      is_active = models.BooleanField(default=False)
  
      class Meta:
          ordering = ['name',]
  
      def __unicode__(self):
          return u'%s' % self.name
  
  # forms.py
  class EntryForm(forms.ModelForm):
      class Meta:
          model = Entry
          exclude = ('user',)
  
  # views.py
  class UpdateEntry(UpdateView):
      model = Entry
      form_class = EntryForm
      template_name = "entry/entry_update.html"
      success_url = reverse_lazy('entry_update')
  
      @method_decorator(login_required)
      def dispatch(self, *args, **kwargs):
          return super(UpdateEntry, self).dispatch(*args, **kwargs)
  
  # urls.py
  url(r'^entry/edit/(?P&lt;pk&gt;\d+)/$',
      UpdateEntry.as_view(),
      name='entry_update'
  ),
  </code></pre>