Right, I've worked out why this is:
django/contrib/admin/options.py - def changelist_view(self, request,
extra_context=None): contains the line:
context = {
'title': cl.title,
'is_popup': cl.is_popup,
'cl': cl,
'media': media,
'has_add_permission': self.has_add_permission(request),
'root_path': self.admin_site.root_path,
'app_label': app_label,
'action_form': action_form,
'actions_on_top': self.actions_on_top,
'actions_on_bottom': self.actions_on_bottom,
}
So, it doesn't add "has_delete_permission" to the context (nor
"has_change_permission") for that matter. Simple fix:
context = {
'title': cl.title,
'is_popup': cl.is_popup,
'cl': cl,
'media': media,
'has_add_permission': self.has_add_permission(request),
addedhere ---> 'has_delete_permission':
self.has_delete_permission(request), <----- added here
'root_path': self.admin_site.root_path,
'app_label': app_label,
'action_form': action_form,
'actions_on_top': self.actions_on_top,
'actions_on_bottom': self.actions_on_bottom,
}
... but ... but ... surely that comes from the land of Harry the
Hacker?
Isn't there a better way to do this, or is this a genuine bug?
Any help or thoughts very welcome,
Cheers
R