title: Use self in ModelForm fields
body: <p>I have a Formview and pass the pk to the ModelForm. In the ModelForm i am not able to use self.pk in the queryset i define for the field:</p>
  
  <p><strong>views.py</strong></p>
  
  <p>[...]</p>
  
  <pre><code>def get_form_kwargs(self):
      # Pass extra kwargs to DetailProductForm
      kwargs = super(DetailProduct, self).get_form_kwargs()
      kwargs.update({'pk': self.kwargs['pk']})
      return kwargs
  </code></pre>
  
  <p><strong>forms.py</strong></p>
  
  <pre><code>class DetailProductForm(forms.ModelForm):
  
  
      def __init__(self, *args, **kwargs):
          # get the pk from the FormView at set it as self.pk
          self.pk = kwargs.pop('pk', None)
          super(DetailProductForm, self).__init__(*args, **kwargs)
  
      # use self.pk in my queryset (there are more fields who use self.pk, this is just one as an example)
      field = forms.ModelChoiceField(queryset=Configuration.objects.filter(product__pk=self.pk), widget=forms.RadioSelect)
  
  
      class Meta:
          model = Configuration
          fields = ['field']
  </code></pre>
  
  <blockquote>
    <p>NameError: name 'self' is not defined</p>
  </blockquote>
  
  <p>How can i use self.pk for the fields?</p>