The admin interface is not designed for such mass deletions. When deleting
millions of objects, it can be necessary to paginate the deletion to avoid
exhausting the resources of your database server. I don't think it's
suitable for a view to try and do this.

Btw in the case of sessions, use the 'clearsessions' management command:
https://docs.djangoproject.com/en/4.1/ref/django-admin/#clearsessions . In
the case of admin logs, I would use 'shell' with the ORM.



On Tue, Aug 16, 2022 at 2:42 PM Danilov Maxim <ma...@wpsoft.at> wrote:

> >> Collapsing the list of to-be-deleted objects could also lead to cases
> of accidental removal of related objects. I think it's better to err on the
> side of overwhelming than hiding information.
>
>
>
> But sometimes It is very painful to delete whole list of sessions (
> database-backed
> <https://docs.djangoproject.com/en/4.1/topics/http/sessions/#using-database-backed-sessions>
> sessions) (4mlo) or Django admin logs (66mlo).
>
>
>
>
>
> Mit freundlichen Grüßen,
>
> DI Mag. Maxim Danilov
>
>
>
> +43(681)207 447 76
>
> ma...@wpsoft.at
>
>
>
> *From:* 'Adam Johnson' via Django developers (Contributions to Django
> itself) [mailto:django-developers@googlegroups.com]
> *Sent:* Tuesday, August 16, 2022 2:55 PM
> *To:* Django developers (Contributions to Django itself) <
> django-developers@googlegroups.com>
> *Subject:* Re: More user friendly delete confirmation template
>
>
>
> If the object to be deleted contains many relations, the user
> is overwhelmed with a list of other objects to be deleted together with the
> current object. Often those objects are just internal relations the user
> never heard of, and this may be unsettling.
>
>
>
> I would argue that if the list of objects is "overwhelming" /
> "unsettling", then this is perhaps an indicator that the admin interface is
> being used beyond its intended scope. The admin is designed for site
> administrators, mostly developers. Yes, most projects seem to push it
> beyond that, but we can't make it something for all people.
>
>
>
> Collapsing the list of to-be-deleted objects could also lead to cases of
> accidental removal of related objects. I think it's better to err on the
> side of overwhelming than hiding information.
>
>
>
> On Tue, Aug 16, 2022 at 1:22 PM Danilov Maxim <ma...@wpsoft.at> wrote:
>
> Hi Jacob.
>
> On the one side - you can override this delete_confirmation.html and
> delete_selected_confirmation.html I do it since dj 1.4
>
>
>
> On the other side I am agree with Jacob - it can be in Django by default.
> – We can add “collapsed” div to wrap <ul> with every objects list, or we
> can add details/summary for that.
>
>
>
> Mit freundlichen Grüßen,
>
> DI Mag. Maxim Danilov
>
>
>
> +43(681)207 447 76
>
> ma...@wpsoft.at
>
>
>
> *From:* django-developers@googlegroups.com [mailto:
> django-developers@googlegroups.com] *On Behalf Of *Jacob Rief
> *Sent:* Tuesday, August 16, 2022 1:57 PM
> *To:* Django developers (Contributions to Django itself) <
> django-developers@googlegroups.com>
> *Subject:* More user friendly delete confirmation template
>
>
>
> Whenever a user attempts to delete an object inside the Django admin,
>
> a delete confirmation page is shown. If the object to be deleted contains
>
> many relations, the user is overwhelmed with a list of other objects to be
>
> deleted together with the current object. Often those objects are just
>
> internal relations the user never heard of, and this may be unsettling.
>
>
>
> I therefore propose to hide those related objects behind a link named
>
> "Show related object to delete"
>
> If the user clicks on that link, the complete list of objects to be
> deleted is
>
> expanded into the confirmation page. This also prevents having to scroll
>
> down to the end of a potentially very long page in order to confirm the
>
> deletion by clicking on "Yes I'm sure".
>
>
>
> [image: Screenshot 2022-08-16 at 13.34.46.png]
>
>
>
> – Jacob
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/e59f0771-cb65-4564-ace4-50a7ffd96cf6n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/e59f0771-cb65-4564-ace4-50a7ffd96cf6n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/000001d8b16a%24d5c5f640%248151e2c0%24%40wpsoft.at
> <https://groups.google.com/d/msgid/django-developers/000001d8b16a%24d5c5f640%248151e2c0%24%40wpsoft.at?utm_medium=email&utm_source=footer>
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CAMyDDM0JL9DqgnoFSehXd5D8d4DjzEzvhrUWwbw5wqUBQdDF3Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-developers/CAMyDDM0JL9DqgnoFSehXd5D8d4DjzEzvhrUWwbw5wqUBQdDF3Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/000401d8b176%2405e12c90%2411a385b0%24%40wpsoft.at
> <https://groups.google.com/d/msgid/django-developers/000401d8b176%2405e12c90%2411a385b0%24%40wpsoft.at?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM2ieJ1Yr6AvH3ZLcX7AhZw7Sk2jNrWOH5gctvs1dkBFYw%40mail.gmail.com.
  • Mor... Jacob Rief
    • ... Danilov Maxim
      • ... 'Adam Johnson' via Django developers (Contributions to Django itself)
        • ... Danilov Maxim
          • ... 'Adam Johnson' via Django developers (Contributions to Django itself)
            • ... Carlton Gibson
              • ... Jacob Rief
                • ... Jacob Rief
        • ... אורי
          • ... Jacob Rief
            • ... Carlton Gibson
              • ... Jacob Rief
                • ... Carlton Gibson

Reply via email to