title: django forms and ModelMultipleChoiceField when working with existing records
body: <p>I'm trying to do something which I would think is quite common, but I'm just really unsure how to tackle this.</p>
  
  <p><strong>What I currently do:</strong> Currently I produce a list of check boxes (using 'CheckboxSelectMultiple') on my form which auto ticks all the users who are in 'members' from the list of all Users in django (produced by "queryset=User.objects.all()"). </p>
  
  <p><strong>What I want to actually do:</strong> I don't want to list every user in Django, I just want to show a list of Users in 'members'. </p>
  
  <p><strong>How I think it can be done:</strong> I think I can do this by modifying the queryset to be something like "project.members.all()" where project = Project (a specific instance of project). But how do I pass this context to my form?</p>
  
  <pre><code># models.py
  class Project(models.Model):
      name = models.CharField(max_length=100)
      members = models.ManyToManyField(User, related_name="members", blank=True, null=True)
  
  
  # forms.py
  class ProjectSettings(forms.Form):
      summary = forms.CharField(max_length=200)
      members = forms.ModelMultipleChoiceField(queryset=User.objects.all(), widget=forms.CheckboxSelectMultiple())
  
  
  #template snippet
          &lt;form method="post" action="/projects/{{ project.slug }}/settings/save/"&gt;
      {% for field in form %}
      &lt;div class="form-row"&gt;
          {{ field.errors }}
          {{ field.label_tag }} {{ field }}
          {% if field.help_text %}
          &lt;p class="help-text"&gt;{{ field.help_text }}&lt;/p&gt;
          {% endif %}
      &lt;/div&gt;
      {% endfor %}
  
  
  # view.py
  def update_project(request, project_slug):
      if request.method == 'POST':
          form = ProjectSettings(request.POST)
          if form.is_valid(): # All validation rules pass
              # Process the data in form.cleaned_data
              project.summary = form.cleaned_data['summary']
              project.members = form.cleaned_data['members']
              project.save()
              return HttpResponseRedirect('/projects/' + project.slug + '/')
      else:
          data_dict = {'summary': project.summary, 'members': project.members.all()}
          form = ProjectSettings(initial=data_dict)
  
      return render_to_response('update_project.html', {'form': form}, context_instance=RequestContext(request))
  </code></pre>
  
  <p>I hope this makes sense, and I do apologise as I really think this is something simple I'm missing here - but I haven't been able to find a specific example showing how to do this with non-model forms.</p>
  
  <p>Thanks in advance,</p>
  
  <p>Jamie</p>