title: I want to update a group of model object but it doesn't work
body: <p>I am trying to assign these to users and using a form for the same model to update it but it doesn't work for some reason, this is the code</p>
  
  <pre><code>def assign_blanks(request):
      if request.method == 'POST':
          form = assign_blank_form(data=request.POST)
          from_value = request.POST.get("from_value", "")
          to_value = request.POST.get("to_value", "")
          blanks = blank.objects.all()
          for b in blanks:
              if b.number &gt;= int(from_value) and b.number &gt;= int(to_value):
                  b.advisor = form.instance.advisor
                  print(b.number)
          return render(request, 'assign_blanks.html')
      else:
          form = assign_blank_form
          return render(request, 'assign_blanks.html', {'form':form})
  
  class assign_blank_form(ModelForm):
      class Meta:
          model = blank
          fields = ['advisor']
  
  
  &lt;form class="box" method = "post"&gt;
      {% csrf_token %}
      &lt;h1&gt;Air Ticket Sales&lt;/h1&gt;
      {{ form }}
      assign from:
      &lt;input type="number" name="from_value" value="{{ from_value }}"&gt;
      assign to:
      &lt;input type="number" name="to_value" value="{{ to_value }}"&gt;
      &lt;input type="submit" name="" value="Assign blanks"&gt;
  
  &lt;/form&gt;
  </code></pre>