title: Django: writing a view to delete multiple object with checkboxes
body: <p>So I have a table that lists all the record from my model.
  But now I'm trying to make a Checkbox and delete it (kinda like the Django admin way), I can't find the documentation for this , as I'm sure there are several ways to to this.
  But I'm trying to figure out like whats the proper way for doing this , should I do this via view ? </p>
  
  <p>How to create single delete button  for  multiple delete instances in html and view.I am not using form
  I refreed this side but not get correct solution 
  <a href="https://stackoverflow.com/questions/4897291/django-writing-a-view-to-delete-an-item-with-checkboxes">Django: writing a view to delete an item with checkboxes</a>
  <a href="https://stackoverflow.com/questions/7496551/deleting-multiple-rows-in-django-frontend">Deleting multiple rows in Django frontend</a></p>
  
  <p><strong>list.html</strong></p>
  
  <pre><code>{% for obj in object_list %}
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;input type="checkbox"  name="data" value="{{obj.id}}" &gt;&lt;/td&gt;
              &lt;td&gt;&lt;a href='#' data-toggle="collapse" value="{{obj.id}}"&gt;{{ obj.id }}&lt;/td&gt;
              &lt;td&gt;&lt;a href='#demo' data-toggle="collapse"&gt;{{ obj.Full_Name }}&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;&lt;a href="#demo" data-toggle="collapse"&gt;{{ obj.Agency_Name}}&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;&lt;a href="#demo" data-toggle="collapse"&gt;{{ obj.Date_of_Birth}}&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;&lt;a href="#demo" data-toggle="collapse"&gt;{{ obj.Agency_Code}}&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;&lt;a href="#demo" data-toggle="collapse"&gt;&lt;span class="label label-primary"&gt;{{ obj.Agent_Status}}&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
  
              &lt;td class="text-right"&gt;
                  &lt;a  href="{{ obj.get_absolute_url }}" class="btn btn-warning btn-circle" type="button"&gt;&lt;i class="fa fa-list-alt" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;
                  &lt;a  href="{% url 'customer:Agent_Edit'  obj.id %}" class="btn btn-info btn-circle" type="button"&gt;&lt;i class="fa fa-pencil-square-o" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;
                  #&lt;a  href="{% url 'customer:Agent_Delete'  obj.id %}" class="btn btn-danger btn-circle" type="button"&gt;&lt;i class="fa fa-trash" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;
                  #Remove this button and create single button for multiple delete
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  {% endfor %}
  </code></pre>
  
  <p><strong>view.py</strong></p>
  
  <pre><code>def Agent_List(request, id=None): #list items
    queryset =  Agent.objects.order_by('id')
    #queryset = Agent.objects.all()   
    query = request.GET.get('q')
    if query:
      queryset=queryset.filter(
              Q(Aadhaar_Number__icontains=query) |
              Q(PAN_Number__icontains=query) |
              Q(Account_Number__icontains=query) 
              ).distinct()
    context = {
      "object_list": queryset, 
      "Full_Name ": "Agent_List",
  
    }
    return  render(request, "customer/Agent_List.html", context)
  
  def Agent_Delete(request, id=None):
    instance = get_object_or_404(Agent, id=id)
    instance.delete()
    messages.success(request, "Successfully deleted")
    return redirect("customer:Agent_List")
  </code></pre>
  
  <p>In def Agent_Delete(request, id=None) it delete single id.but How to delete selected multiple id.Thank you in advance. </p>