def delete_selected(self, request, queryset):
opts = self.model._meta<EOL>app_label = opts.app_label<EOL>deletable_objects, model_count, perms_needed, protected = self.get_deleted_objects(request, queryset)<EOL>if request.POST.get('<STR_LIT>') and not protected:<EOL><INDENT>if perms_needed or protected:<EOL><INDENT>raise PermissionDenied<EOL><DEDENT>n = queryset.count()<EOL>if n:<EOL><INDENT>for obj in queryset:<EOL><INDENT>obj_display = force_text(obj)<EOL>self.log_deletion(request, obj, obj_display)<EOL><DEDENT>queryset.delete()<EOL>self.message_user(request, _("<STR_LIT>") % {<EOL>"<STR_LIT:count>": n, "<STR_LIT>": model_ngettext(self.opts, n)<EOL>}, messages.SUCCESS)<EOL><DEDENT>return None<EOL><DEDENT>sz = queryset.count()<EOL>if sz == <NUM_LIT:1>:<EOL><INDENT>objects_name = _('<STR_LIT>') % {<EOL>'<STR_LIT>': force_text(opts.verbose_name),<EOL>'<STR_LIT:object>': queryset[<NUM_LIT:0>]<EOL>}<EOL><DEDENT>else:<EOL><INDENT>objects_name = _('<STR_LIT>') % {<EOL>'<STR_LIT>': force_text(opts.verbose_name_plural),<EOL>'<STR_LIT:count>': sz<EOL>}<EOL><DEDENT>if perms_needed or protected:<EOL><INDENT>title = _("<STR_LIT>") % {"<STR_LIT:name>": objects_name}<EOL><DEDENT>else:<EOL><INDENT>title = _("<STR_LIT>")<EOL><DEDENT>context = dict(<EOL>self.admin_site.each_context(request),<EOL>title=title,<EOL>objects_name=objects_name,<EOL>deletable_objects=[deletable_objects],<EOL>model_count=dict(model_count).items(),<EOL>queryset=queryset,<EOL>perms_lacking=perms_needed,<EOL>protected=protected,<EOL>opts=opts,<EOL>action_checkbox_name=helpers.ACTION_CHECKBOX_NAME,<EOL>media=self.media,<EOL>)<EOL>request.current_app = self.admin_site.name<EOL>return TemplateResponse(request, self.delete_selected_confirmation_template or [<EOL>"<STR_LIT>" % (app_label, opts.model_name),<EOL>"<STR_LIT>" % app_label,<EOL>"<STR_LIT>"<EOL>], context)<EOL>
The real delete function always evaluated either from the action, or from the instance delete link