#10919: Add an option to disable display of related items on admin's delete confirmation page (to prevent large memory usage on complex objects) ------------------------------------+------------------------------------ Reporter: Tobias McNulty | Owner: nobody Type: New feature | Status: new Component: contrib.admin | Version: master Severity: Normal | Resolution: Keywords: admin memory limit | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 ------------------------------------+------------------------------------
Comment (by terminator14): I am using Django 2.2.10, and this is still an issue. If I am using Django Admin to delete an object with millions of related records, it tries to generate the list, takes too long, and my browser gives up waiting, showing an error loading the page. I'm not sure how difficult this is to do, but I have some thoughts: When deleting an object from Django Admin, the summary section is great, but I really like the fact that Django Admin lists all effected related objects. If the summary section was the only thing on the page, someone deleting an object may think "pfft - I know exactly what happens if I delete this", and delete it without a second thought, without even bothering to glance at the summary of the number of related objects that will be effected. I know this sounds like a "that's their problem" type of deal, but if we can prevent this, why wouldn't we? The list of effected objects that Django Admin currently provides is very clear. As soon as the page loads, if you think you are about to delete one object, but you see a massive list of effected stuff, you immediately start looking into what you are deleting, and why it effects more than what you expected. I think a good solution would be a middle-ground, rather than disabling the list of related objects. If you are about to delete an object with a million related objects, have django do a DB query with something like "limit 100". It will pull 100 related objects, quickly generate the HTML page without trying to list a million objects on the page, and the user will still have the advantage of quickly seeing that his delete operation will effect a ton of objects, since he'll have a hundred objects listed on the page. To make things clear, add a message at the bottom that says something like "and 999,900 others" or something. This will tell them that the 100 objects listed aren't the only ones to be deleted. Any thoughts? -- Ticket URL: <https://code.djangoproject.com/ticket/10919#comment:13> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.8ef80256ef305da32f8e4b8bd68cff8d%40djangoproject.com.