Opened 18 years ago
Closed 16 years ago
#2383 closed enhancement (fixed)
[patch] delete multiple items at once
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | normal | Keywords: | djangocon |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | yes |
Needs tests: | yes | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
In response to http://www2.jeffcroft.com/2006/jul/20/top-ten-things-suck-about-django/ #3 Admin interface: inability to delete multiple items at once.
I came up with this patch because I had the same need. I had a few thoughts of how to implement this, but I went with this way because it seemed to follow the way the Django admin works.
Feedback is appreciated.
Attachments (8)
Change History (22)
by , 18 years ago
Attachment: | multi_delete.diff added |
---|
by , 18 years ago
Attachment: | tooltag-delete_over.gif added |
---|
by , 18 years ago
Attachment: | tooltag-delete.gif added |
---|
comment:1 by , 18 years ago
by , 18 years ago
by , 18 years ago
Attachment: | new_multi_delete.diff added |
---|
comment:2 by , 18 years ago
I updated this patch to work with people who are superusers. Before only people that had explicit permisions got the delete box.
Also Trac would not let me override the diff file, so I renamed it new_multi_delete.diff
Jay Graves
comment:4 by , 18 years ago
Looks good, I would like to see the deletion go through an "Are you sure" step just like the normal delete_stage process. Also I was unable to delete objects that had primary keys based on something other than the auto_increment id. I'm including a patch based on your patch.
It needs the accompanying deletelist_confirmation.html.
I also replaced the need for delete.js with the following change to the delete anchor:
... onclick="document.getElementById('delete_form_checked').submit()"
by , 18 years ago
Attachment: | deletelist_confirmation.html added |
---|
template to allow for confirmation of deletion
comment:5 by , 18 years ago
I'm interested in this functionality, too. Though, there are a couple things about the patches.
User's "has_delete_permissions" wasn't being set correctly. The patch I'm including fixes this. Also, I think this should be done by a regular form POST, not with the JavaScript onsubmit handler. The updated patch does this now.
Some warts still: Using the form submit, the "Delete checked" button falls at the bottom of the page, which on long pages may not be good. Maybe this doesn't matter. Also, I'm not sure if the "Delete?" check box should appear on every object's list page. Maybe this should be an Admin option on the model, and then, if permissions are present, the functionality appears.
Also, the patch I'm attaching includes the template changes inline with the rest of the code.
by , 18 years ago
Attachment: | deletelist_with_templates_updated.diff added |
---|
New patch, fixing "has_delete_permissions" and doing a proper form POST submit (sans JavaScript)
comment:6 by , 18 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
Looks really good! There's still some decisions to make but I'm pretty sure this will get accepted. Good work Jay, atlithorn and deryck.
comment:7 by , 17 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Closed as wontfix, repoen if patch works against newforms-admin.
comment:8 by , 17 years ago
Resolution: | wontfix |
---|---|
Status: | closed → reopened |
Please don't do that; feature requests that are worth considering for newforms-admin should remain open until newforms-admin is done.
comment:9 by , 17 years ago
Triage Stage: | Design decision needed → Someday/Maybe |
---|
At some point in the future we're going to revisit the design/behavior of the admin, and this will certainly be part of that process. However, we're not in a hurry to add bits on piecemeal since that could lead to crufty UI.
comment:10 by , 17 years ago
Keywords: | nfa-changelist added |
---|
comment:11 by , 16 years ago
Keywords: | djangocon added |
---|
comment:12 by , 16 years ago
Keywords: | nfa-changelist removed |
---|---|
Needs documentation: | set |
Needs tests: | set |
Patch needs improvement: | set |
Triage Stage: | Someday/Maybe → Accepted |
comment:13 by , 16 years ago
http://code.google.com/p/django-batchadmin/
Just adding this here since it is definitely relevant and nicely designed.
comment:14 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Fixed in r10121, allowing bulk actions in the admin.
I guess you need to attach delete.js as well for the patch to work? I wrote a patch for this a couple of weeks ago as well but I don't want to make this more difficult than necessary, if yours works then we'll just dump ours for yours.