'Updating multiple checkboxes forms with Django

in my django website I'm trying to building a page in which there are multiple forms (In particular 3: the first is simply a checkbox, as the second one. The third one requires the entering of two text fields). I've already managed the presence of multiple forms and I've no problem when the user performs the first assignment. The problem is instead during the updating of the answers that the user gave the first time: there are no problems when adding new instances of the text fields of the third form, while instead if I've selected one checkbox of the first two forms and I want to change them unchecking them it seems like django doesn't save the new values. Any idea of why it's happening?

Here's the view associated:

def new_4e2(request, pk, var=None):
    
    if Specifiche.objects.filter(ID_rich = pk).exists():
        specs = Specifiche.objects.filter(ID_rich = pk)
        choicesp =[]
        lista =[]
        for spec in specs:
            choicesp+=[(spec.id, str(spec.rif))]
            lista+=[spec.id]
    
    att = MAIN.objects.get(id=pk)
    unform = FormUn(instance=att)
    data = {'ID_rich': pk}
    form = UnicitaForm(initial=data)
    form.fields['rifext'].choices = choicesp
   
    

    if Unicita.objects.filter(rifext__in = lista).exists():
        uns=Unicita.objects.filter(rifext__in = lista)
        context={
            'att': att,
            'uns': uns,
            'var':var,
            'specs': specs
        }   
    else:
        context = {
        'att': att,
        'var':var,
        'specs': specs,
        }  
   
    form = UnicitaForm(initial = data)
    form.fields['rifext'].choices = choicesp
    similiform = SimiliForm(instance=att)
    if request.method=='POST':
        if 'Aggiungi' in request.POST:
            form = UnicitaForm(request.POST, initial=data)
            form.fields['rifext'].choices = choicesp
            if form.is_valid():
                form.save()
                return redirect(f'/new_4e2/{pk}/{var}//')

        if 'Simili' in request.POST:
            similiform = SimiliForm(request.POST, instance=att)
            if similiform.is_valid():
                similiform.save()
                return redirect(f'/new_4e2/{pk}/{var}//')

        if 'Unicita' in request.POST:
            unform = FormUn(request.POST, instance=att)
            if unform.is_valid():
                unform.save()
                return redirect(f'/new_4e2/{pk}/{var}//')

    context = context | {'form': form, 'unform':unform, 'similiform': similiform}
    return render(request, 'new_4e2.html', context)

The two forms for which I have this problems are: 'unform' and 'similiform'

And here is my template.html

<form method="POST">
    {% csrf_token %} 4.1 | {{unform}} 
    <input type="submit" name="Unicita">
  </form> 

{% if not att.Unicita %}
<div style="position:relative; left:50 px; height: 10 px; width:500 px;"> 

  <form method="POST">
    {% csrf_token %} {{similiform}} 
    <input type="submit" name="Simili">
  </form>

<form action ="" method="POST">
    {% csrf_token %}
    <h4>Insert Unicita</h4>
    {{form}}

    <input type="submit" name="Aggiungi">
</form>

...


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source