title: Django Form for ManyToMany fields
body: <p>I have to design a form for add a new post in my blog.</p>
  
  <p>Model.py  </p>
  
  <pre><code>class Category(models.Model):
      title = models.CharField(max_length=200)
      ...
      ...
      def __unicode__(self):
          return self.title
  
  class Post(models.Model):
  
      title = models.CharField(max_length=80)
      pub_date = models.DateTimeField()
      text = models.CharField(max_length=140)
      ...
  
      categories = models.ManyToManyField(Category, blank=True, null=True, through='CategoryToPost')
  
      def __unicode__(self):
          return self.title
  
  class CategoryToPost(models.Model):
  
      post = models.ForeignKey(Post)
      category = models.ForeignKey(Category)
  </code></pre>
  
  <p>Views.py</p>
  
  <pre><code>def add_post(request):
  
  form = PostForm()
  if request.method == "POST":
      form = PostForm(request.POST)
      if form.is_valid():
          form = PostForm(request.POST)
          post = form.save(commit=False)
          post.author = User.objects.get(id = request.user.id)
          post.categories = post.categorytopost_set
          ...
          post.save()
          return HttpResponseRedirect('/')
      else:
          return render(request, 'add_post.html', {'error': True, 'form': form})
  else:
      return render(request, 'add_post.html', {'error': True, 'form': form})
  </code></pre>
  
  <p>Form.py</p>
  
  <pre><code>class PostForm(ModelForm):
  
      class Meta:
          model = Post
          fields = ('title', 'text', 'categories', 'tags')
  </code></pre>
  
  <p>When I try to insert catogories in new post from template "add_post.html" there is always an error refers to ManyToMany:</p>
  
  <p>"Cannot set values on a ManyToManyField which specifies an intermediary model. Use CategoryToPosts Manager instead."</p>