title: What are the steps to make a ModelForm work with a ManyToMany relationship with an intermediary model in Django?
body: <ul>
  <li>I have a <em>Client</em> and <em>Groupe</em> Model.</li>
  <li>A <em>Client</em> can be part of multiple <em>groups</em>.</li>
  <li><em>Clients</em> that are part of a group can use its group's free rental rate at anytime but only once. That is where the intermediary model (<em>ClientGroupe</em>) comes in with that extra data.</li>
  </ul>
  
  <p>For now, when I try to save the m2m data, it just dies and says I should use the ClientGroupe Manager...so what's missing?</p>
  
  <h2>Here are my models:</h2>
  
  <pre><code>class Groupe(models.Model):
      nom = models.CharField(max_length=1500, blank=True)
  
  class Client(models.Model):
      nom = models.CharField(max_length=450, blank=True)
      prenom = models.CharField(max_length=450, blank=True)
      groupes = models.ManyToManyField(Groupe, null = True, blank = True, through='ClientGroupe')
  
  class ClientGroupe(models.Model):
      client = models.ForeignKey(Client)
      groupe = models.ForeignKey(Groupe)
      dt = models.DateField(null=True, blank=True) # the date the client is using its group's free rental rate    
  
      class Meta:
          db_table = u'clients_groupes'
  </code></pre>
  
  <h2>and here's my view:</h2>
  
  <pre><code>def modifier(request, id):
      client = Client.objects.get(id=id)    
      form = ClientForm(instance = client)
  
      dict = {
          "form": form
          , "instance" : client
      }
  
      if request.method == "POST":
          form = ClientForm(request.POST, instance = client)
  
          if form.is_valid():
              client_mod = form.save()
  
              id = client_mod.id
              return HttpResponseRedirect(
                  "/client/%(id)s/?err=success" % {"id" : id}
              )
          else:
              return HttpResponseRedirect(
                  "/client/%(id)s/?err=warning" % {"id" : id}
              )
  
      return render_to_response(
          "client/modifier.html"
          , dict
          , context_instance=RequestContext(request)
      )
  </code></pre>
  
  <p><strong>EDIT</strong>:</p>
  
  <p>and here's the ClientForm code:</p>
  
  <pre><code>class ClientForm(ModelForm):
      class Meta:
          model = Client
  </code></pre>
  
  <p><strong>EDIT #2</strong>:
  here's the error message:</p>
  
  <pre><code>AttributeError at /client/445/
  
  Cannot set values on a ManyToManyField which specifies an intermediary model. Use ClientGroupe's Manager instead.
  
  Request Method:     POST
  Request URL:    http://localhost/client/445/
  Exception Type:     AttributeError
  Exception Value:    Cannot set values on a ManyToManyField which specifies an intermediary model.  Use ClientGroupe's Manager instead.
  
  Exception Location:     C:\Python25\lib\site-packages\django\db\models\fields\related.py  in __set__, line 574
  Python Executable:  C:\xampp\apache\bin\apache.exe
  Python Version:     2.5.2
  </code></pre>