title: django form: Passing parameter from view.py to forms gives out error
body: <p>Newbie question:
  I need to accept a parameter in a form from a method in views.py but it gave me troubles. In the view I created a method with following snippet:</p>
  
  <pre><code>def scan_page(request):
      myClient = request.user.get_profile().client
      form = WirelessScanForm(client = myClient)   # pass parameter to the form
  </code></pre>
  
  <p>and in the forms.py I defined the following form:</p>
  
  <pre><code>class WirelessScanForm(forms.ModelForm):
      time = forms.DateTimeField(label="Schedule Time", widget=AdminSplitDateTime())
  
      def __init__(self,*args,**kwargs):
          myClient = kwargs.pop("client")     # client is the parameter passed from views.py
          super(WirelessScanForm, self).__init__(*args,**kwargs)
          prob = forms.ChoiceField(label="Sniffer", choices=[ x.sniffer.plug_ip for x in Sniffer.objects.filter(client = myClient) ])
  </code></pre>
  
  <p>But django keeps giving me error saying: <code>TemplateSyntaxError: Caught NameError while rendering: name 'myClient' is not defined</code>(This error happens in the query)</p>
  
  <p>I'm afraid it would be something stupid missing here, but I cannot really figure out why. Please help, thanks.</p>