Opened 22 months ago

Last modified 18 months ago

#33868 closed Cleanup/optimization

Admin “delete object(s)” view: improve labels of m2m relations — at Version 1

Reported by: julian@pinabausch.org Owned by: nobody
Component: contrib.admin Version: 4.0
Severity: Normal Keywords: admin, delete view
Cc: julian@pinabausch.org, Adam Johnson Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by julian@pinabausch.org)

When deleting an object that has m2m relations in Django Admin, it shows a nice overview of what’s going to be deleted, including the records from m2m relations. An example screenshot is attached to the ticket.

The labels for the m2m relations are constructed like this:

Photo-person relationship: Photo_depicts object (1)

Photo-person relationship makes perfect sense to me; Photo_depicts object (1) could be improved.

I suggest using the labels of the string representation of the concrete from- and to-objects.

Let me know what you think about it and I will see if I can come up with a patch.

Background:
Two years ago, I had a discussion on the Django developers mailing list about improving the labels that are used for m2m relations in Django Admin’s delete view. While reviewing old tickets to day, I checked the mailing list again and thought “Why not give it another shot?”.
https://groups.google.com/g/django-developers/c/TxZtZyB3kpc

Change History (2)

by julian@pinabausch.org, 22 months ago

Delete view sample – deleting a Photo instance that has a “depcits” relation to four people

comment:1 by julian@pinabausch.org, 22 months ago

Cc: julian@pinabausch.org added
Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top