So I have a model that includes:
class Place(models.Model):
....
created_by = models.ForeignKey(User)
My view is like so:
class PlaceFormView(CreateView):
form_class = PlaceForm
@method_decorator(login_required)
def dispatch(self, *args, **kwargs):
return super(PlaceFormView, self).dispatch(*args, **kwargs)
Is there a way for me to access request.user and set created_by to that user? I've looked through the docs, but can't seem to find any hints toward this.
`