title: Django: how to pass parameters to forms
body: <p>I have a Django form that is rendered with bootstrap3.  I want to be able to pass parameters into my form to make it more generic. My forms looks like:</p>
  
  <pre><code>class SpacecraftID(forms.Form):
    def __init__(self,*args,**kwargs):
      choices = kwargs.pop('choices')
      #self.choices = kwargs.pop('choices') produces same error
      super(SpacecraftID,self).__init__(*args,**kwargs)
  
    scID = forms.MultipleChoiceField(required=False, widget=forms.CheckboxSelectMultiple, choices=choices)
  </code></pre>
  
  <p>And my view looks like:</p>
  
  <pre><code>def schedule_search(request):
   choices = (
      ('1','SAT1'),
      ('2','SAT2'),
      ('3','SAT3'),
      )
  
   if request.method == 'POST':
      form_ID = SpacecraftID(request.POST,choices=choices)
      if form.is_valid():
          scID = form_ID.cleaned_data['scID']
  
   else:
      form_ID = SpacecraftID(choices=choices)
  
   return render(request, 'InterfaceApp/schedule_search.html', {'form3': form_ID})
  </code></pre>
  
  <p>When I run this code I get the error:</p>
  
  <p>NameError at /InterfaceApp/schedule_search/,
  name 'choices' is not defined</p>