[Django] #36757: Optionally ignore change event in list view

7 views
Skip to first unread message

Django

unread,
Nov 25, 2025, 3:52:53 AM (8 days ago) Nov 25
to django-...@googlegroups.com
#36757: Optionally ignore change event in list view
-------------------------------------+-------------------------------------
Reporter: Jacob Rief | Type:
| Cleanup/optimization
Status: new | Component:
| contrib.admin
Version: dev | Severity: Normal
Keywords: list-view, change- | Triage Stage:
event | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
I am the author of the popular 3rd party library https://github.com/jrief
/django-admin-sortable2 used in approximately 1.5% of all Django
installations. It is used to sort the entries in the list view of the
Django-Admin. There however is a problem: Whenever one reorders entries
and immediatly afterwards attemps to delete an entry, an alert message
pops up, warning the user about unsaved changes.
Please check this issue https://github.com/jrief/django-admin-
sortable2/issues/397 for details.

The easiest solution to fix this would be to just ignore that change. By
applying this simple patch:

{{{
--- a/django/contrib/admin/static/admin/js/actions.js
+++ b/django/contrib/admin/static/admin/js/actions.js
@@ -151,7 +151,7 @@
updateCounter(actionCheckboxes, options);
lastChecked = target;
} else {
- list_editable_changed = true;
+ list_editable_changed = !target.classList.contains
('ignore-list-changes');
}
});
});
}}}


this issue can be solved without causing any harm to other applications. I
then would apply the CSS class `ignore-list-changes` to the `<tbody>`
before dragging an entry and remove it afterwards. Btw., a few lines
above, the CSS class `action-select` is used to prevent a similar use-
case, so this patch follows the same logic.

This patch can also be used by other 3rd party libraries which change
fields inside the list view and want to prevent such a warning message.

The class name `ignore-list-changes` is of course open for debate.

If this patch is accepted, I'll create a pull request.
--
Ticket URL: <https://code.djangoproject.com/ticket/36757>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 30, 2025, 3:43:43 AM (3 days ago) Nov 30
to django-...@googlegroups.com
#36757: Optionally ignore change event in list view
-------------------------------------+-------------------------------------
Reporter: Jacob Rief | Owner: Ahmed
Type: | Asar
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: list-view, change- | Triage Stage:
event | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ahmed Asar):

* owner: (none) => Ahmed Asar
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/36757#comment:1>

Django

unread,
Nov 30, 2025, 3:51:50 AM (3 days ago) Nov 30
to django-...@googlegroups.com
#36757: Optionally ignore change event in list view
-------------------------------------+-------------------------------------
Reporter: Jacob Rief | Owner: Ahmed
Type: | Asar
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: list-view, change- | Triage Stage:
event | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Ahmed Asar):

Hi Jacob,

Sorry for the confusion — I think the ticket was assigned to me by mistake
during triage. I didn’t mean to take it over without checking with you
first, especially since you’re the one who proposed the solution and
offered to submit a PR.
--
Ticket URL: <https://code.djangoproject.com/ticket/36757#comment:2>

Django

unread,
Nov 30, 2025, 6:08:23 PM (2 days ago) Nov 30
to django-...@googlegroups.com
#36757: Optionally ignore change event in list view
-------------------------------------+-------------------------------------
Reporter: Jacob Rief | Owner: Ahmed
Type: | Asar
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: list-view, change- | Triage Stage:
event | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Rief):

My question is, if I shall proceed on this, or if it will be closed as
unplanned. I can imagine that other 3rd party apps may also profit from
this feature.
--
Ticket URL: <https://code.djangoproject.com/ticket/36757#comment:3>
Reply all
Reply to author
Forward
0 new messages