title: How can I deal with a massive delete from Django Admin?
body: <p>I'm working with Django 2.2.10.</p>
  
  <p>I have a model called <code>Site</code>, and a model called <code>Record</code>.
  Each record is associated with a single site (Foreign Key).</p>
  
  <p>After my app runs for a few days/weeks/months, each site can have thousands of records associated with it. I use the database efficiently, so this isn't normally a problem.</p>
  
  <p>In Django Admin, when I try to delete a site however, Django Admin tries to figure out every single associated object that will also be deleted, and because my ForeignKey uses <code>on_delete=models.CASCADE</code>, which is what I want, it tries to generate a page that lists thousands, possibly millions of records that will be deleted. Sometimes this succeeds, but takes a few seconds. Sometimes the browser just gives up waiting.</p>
  
  <p>How can I have Django Admin not list every single <code>record</code> it intends to delete? Maybe just say something like "x number of records will be deleted" instead.</p>
  
  <p>Update: Should I be overriding Django admin's delete_confirmation.html? It looks like the culprit might be this line:</p>
  
  <pre><code>&lt;ul&gt;{{ deleted_objects|unordered_list }}&lt;/ul&gt;
  </code></pre>
  
  <p>Or is there an option somewhere that can be enabled to automatically not list every single object to be deleted, perhaps if the object count is over X number of objects?</p>
  
  <p>Update 2: Removing the above line from delete_confirmation.html didn't help. I think it's the view that generates the deleted_objects variable that is taking too long. Not quite sure how to override a Django Admin view</p>