title: Django: AttributeError
body: <pre><code>class EventDeleteView(generic.FormView):
      form_class = EventDeleteForm
      template_name = 'event/event_delete.html'
  
      def __init__(self, **kwargs):
          super().__init__(**kwargs)
     ---&gt; self.event = Event.objects.get(pk=self.kwargs['pk'])
  
      def get_form_kwargs(self):
          kwargs = super().get_form_kwargs()
     ---&gt; kwargs['pk'] = self.kwargs['pk']
  </code></pre>
  
  <p>What I do not understand is why <code>self.kwargs['pk']</code> in the <code>get_form_kwargs(self)</code> method works and why it does not work in the constructor.</p>
  
  <p>I get this error: <code>'EventDeleteView' object has no attribute 'kwargs'</code></p>