#NEWLINE# @ filter_hook #NEWLINE# def do_action( self , queryset ) : #NEWLINE# #INDENT# if ( not self . has_delete_permission ( ) ) : #NEWLINE# #INDENT# raise PermissionDenied #NEWLINE# #UNINDENT# using = router . db_for_write ( self . model ) #NEWLINE# ( deletable_objects , model_count , perms_needed , protected ) = get_deleted_objects ( queryset , self . opts , self . user , self . admin_site , using ) #NEWLINE# if self . request . POST . get ( 'post' ) : #NEWLINE# #INDENT# if perms_needed : #NEWLINE# #INDENT# raise PermissionDenied #NEWLINE# #UNINDENT# self . delete_models ( queryset ) #NEWLINE# return None #NEWLINE# #UNINDENT# if ( len ( queryset ) == 1 ) : #NEWLINE# #INDENT# objects_name = force_unicode ( self . opts . verbose_name ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# objects_name = force_unicode ( self . opts . verbose_name_plural ) #NEWLINE# #UNINDENT# if ( perms_needed or protected ) : #NEWLINE# #INDENT# title = ( _ ( 'Cannot delete %(name)s' ) % { #NEWLINE# #INDENT# 'name' : objects_name , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# title = _ ( 'Are you sure?' ) #NEWLINE# #UNINDENT# context = self . get_context ( ) #NEWLINE# context . update ( { #NEWLINE# #INDENT# 'title' : title , #NEWLINE# 'objects_name' : objects_name , #NEWLINE# 'deletable_objects' : [ deletable_objects ] , #NEWLINE# 'queryset' : queryset , #NEWLINE# 'perms_lacking' : perms_needed , #NEWLINE# 'protected' : protected , #NEWLINE# 'opts' : deletable_objects . opts , #NEWLINE# 'app_label' : self . app_label , #NEWLINE# 'action_checkbox_name' : ACTION_CHECKBOX_NAME , #NEWLINE# #UNINDENT# } ) #NEWLINE# return TemplateResponse ( self . request , ( self . delete_selected_confirmation_template or self . get_template_list ( 'views/model_delete_selected_confirm.html' ) ) , context , current_app = self . admin_site . name )