title: Django MultipleChoiceField and model instance
body: <p>I am trying to pass a queryset to form's field. I am trying to display developers that are filtered by current project (I am getting current project by slug). Unfortunately, I am getting an error, that <code>global name 'project' is not defined</code>. It seems that the argument doesn't pass from form instance to the forms.py file or something...</p>
  
  <p>This is my forms.py:</p>
  
  <pre><code>class TaskForm(ModelForm):
      class Meta:
          model = Task
          fields = ('iteration', 'story', 'description',  )
  
      def __init__(self, *args, **kwargs):
          self.project = kwargs.pop('project')
          super(TaskForm, self).__init__(*args, **kwargs)
          self.fields['developer'] = forms.ModelMultipleChoiceField(queryset = Developer.objects.filter(project = project)) # this is where I want my objects to filter
  </code></pre>
  
  <p>This is how I am initialising the form:</p>
  
  <pre><code>project = Project.objects.get(user=user, slug=slug)
  taskForm = TaskForm(request.POST, project = project)
  </code></pre>
  
  <p>This is the model:</p>
  
  <pre><code>class Developer(models.Model):
  task = models.ManyToManyField(Task)
  </code></pre>
  
  <p>I think that the solution is pretty obvious, but I can't get it working.</p>