title: How to perform .delete() queryset in Django in a ListView?
body: <p>Here is what I've done so far:</p>
  
  <p>1.) I've made a javascript function that gets all the id's of the items (using checkbox select) in the database like so (this is DataTables):</p>
  
  <pre><code>function () {
      // count check used for checking selected items.
      var count = table.rows( { selected: true } ).count();
  
      // Count check.
      // Count must be greater than 0 to delete an item.
      // if count &lt;= 0, delete functionality won't continue.
      if (count &gt; 0) {
          var data = table.rows( { selected: true } ).data();
  
          var list = []; 
  
          for (var i=0; i &lt; data.length ;i++){
             // alert(data[i][2]);
             list.push(data[i][2]);
          }
  
          var sData = list.join();
  
          // alert(sData)
          document.getElementById('delete_items_list').value = sData;
          }
  }
  </code></pre>
  
  <p>It outputs something like <code>1,2,5,7</code> depending on what rows I have selected.</p>
  
  <p>2.) Passed the values inside a <code>&lt;input type="hidden"&gt;</code>.</p>
  
  <p>Now, I've read a <a href="https://stackoverflow.com/a/4898070/7209628">post that says you can delete data in Django database using a checkbox,</a> but I'm not sure how exactly can I use this.</p>
  
  <p>I'm guessing I should put it in the ListView that I made, but how can I do that when I click the "Delete selected items" button, I can follow <a href="https://stackoverflow.com/a/4898070/7209628">this answer?</a></p>
  
  <p>I'm trying to achieve what Django Admin looks like when you delete items.</p>
  
  <p>My ListView looks like this:
  <a href="https://i.stack.imgur.com/xrSGO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xrSGO.png" alt="enter image description here"></a></p>