title: Django inlineformset_factory and ManyToManyField field, once again
body: <p>first of all, sorry for my English!
  I have a little problem with "inlineformset_factory" and "ManyToManyField". Perhaps the option "inlineformset_factory" isn't the right choice.
  I have two classes, Prodotti and Categoria. In models.py are</p>
  
  <pre><code>class Categoria(models.Model):
      ''' tabella delle Categorie dei prodotti '''
      NomeCategoria = models.CharField(max_length=50,blank=True,null=True)
  class Prodotti(models.Model):
      ''' tabella Prodotti a catalogo '''
      NomeProdotto = models.CharField(max_length=50,blank=True,null=True)
      CategoriaProdotto = models.ManyToManyField(Categoria, related_name='prodotti_categoria')
  </code></pre>
  
  <p>I need a form to modify the name of a specific Categoria, es. Antiossidante, and eventually change the list of Prodotti that have this Categoria.
  I try a lot with "inlineformset_factory" and the use of "Prodotti.CategoriaProdotto.through" but I have problems with fields, only "id" is accepted. i.e.</p>
  
  <pre><code>ProdottiFormset = inlineformset_factory(Categoria, Prodotti.CategoriaProdotto.through, fields=('id',))
  </code></pre>
  
  <p>But, changing the name of Categoria it isn't saved.
  This is my project:</p>
  
  <pre><code>views.py
  
  def ModificaCategoria(request, pk):
      # recuperiamo la categoria da modificare, bisogna passare l'ID
      categoria = get_object_or_404(Categoria, pk=pk)
      ProdottiFormset = inlineformset_factory(Categoria, Prodotti.CategoriaProdotto.through, fields=('id',))
  
      if request.method == "POST":
          form = CategoriaModelForm(request.POST, request.FILES, instance=categoria)
          formset = ProdottiFormset(request.POST, instance=categoria)
          if formset.is_valid():
              formset.save()
              return render(request, "dopo_modifica_categoria.html")
              # return redirect(...)
      else:
          categoria = Categoria.objects.get(pk=pk)
          form = CategoriaModelForm(instance=categoria)
          formset = ProdottiFormset(instance=categoria)
  
      context = {
          "form": form,
          "formset": formset,
          }
      return render(request, "modifica_categoria.html", context)
  </code></pre>
  
  <p>Template:</p>
  
  <pre><code>{% extends 'base.html'%}
  {% block head_title %}{{ block.super }} - Modifica categoria{% endblock head_title %}
  {% load crispy_forms_tags %}
  {% block content %}
      &lt;form method="post"&gt;
          {% csrf_token %}
          {{ form.NomeCategoria|as_crispy_field }}
          {{ formset.as_p }}
          &lt;button type="submit" class="btn btn-primary btn-sm"&gt;Modifica&lt;/button&gt;
          &lt;br&gt;
      &lt;/form&gt;
  {% endblock content %}
  </code></pre>
  
  <p>And form.py</p>
  
  <pre><code>class CategoriaModelForm(forms.ModelForm):
      class Meta:
          model = Categoria
          fields = "__all__"
  </code></pre>
  
  <p>Thank you very much for every suggestion!</p>
  
  <p>The next step should create a new Categoria and Prodotti in that Categoria.</p>