diff -Naur admin.old/actions.py admin/actions.py
old
|
new
|
|
48 | 48 | for obj in queryset: |
49 | 49 | obj_display = str(obj) |
50 | 50 | modeladmin.log_deletion(request, obj, obj_display) |
51 | | modeladmin.delete_queryset(request, queryset) |
| 51 | actually_deleted_count = modeladmin.delete_queryset(request, queryset) |
| 52 | if actually_deleted_count is not None: |
| 53 | n = actually_deleted_count |
52 | 54 | modeladmin.message_user( |
53 | 55 | request, |
54 | 56 | _("Successfully deleted %(count)d %(items)s.") |
diff -Naur admin.old/options.py admin/options.py
old
|
new
|
|
1233 | 1233 | obj.delete() |
1234 | 1234 | |
1235 | 1235 | def delete_queryset(self, request, queryset): |
1236 | | """Given a queryset, delete it from the database.""" |
1237 | | queryset.delete() |
| 1236 | """ |
| 1237 | Given a queryset, delete it from the database. |
| 1238 | Optionally return the number of items deleted. |
| 1239 | """ |
| 1240 | actually_deleted_count, _objecttypes = queryset.delete() |
| 1241 | return actually_deleted_count |
1238 | 1242 | |
1239 | 1243 | def save_formset(self, request, form, formset, change): |
1240 | 1244 | """ |