Hacking involving passing a hidden field does not make sense, since it really has nothing to do with the client - this classic problem of βassociate with a registered userβ should definitely be performed on the server side.
I would put this behavior in the form_valid method.
class MyUpdateView(UpdateView): def form_valid(self, form): instance = form.save(commit=False) instance.user = self.request.user super(MyUpdateView, self).save(form)
Yuji 'Tomita' Tomita
source share