title: set the logged in user to created_by for django CreateView
body: <p>Apart from form_valid() method what are the other efficient ways i can set the user to created by.</p>
  <p><strong>views.py</strong></p>
  <pre><code>class CreatEEView(LoginRequiredMixin, CreateView,):
      form_class =  ''
      template_name = ''
      success_url = ''
  
      def form_valid(self, form):
         instance = form.instance
         instance.created_by = Model.objects.get(user=self.request.user)
         instance.save()
         return super().form_valid(form)
  </code></pre>