(self, object_id, *args, **kwargs)
The 'delete' admin view for this model.
The 'delete' admin view for this model.
The delete admin view for this model .
def init_request(self, object_id, *args, **kwargs):
        "The 'delete' admin view for this model."
        self.obj = self.get_object(unquote(object_id))

        if not self.has_delete_permission(self.obj):
            raise PermissionDenied

        if self.obj is None:
            raise Http404(_('%(name)s object with primary key %(key)r does not exist.') % {'name': force_text(self.opts.verbose_name), 'key': escape(object_id)})

        using = router.db_for_write(self.model)

        # Populate deleted_objects, a data structure of all related objects that
        # will also be deleted.
        (self.deleted_objects, model_count, self.perms_needed, self.protected) = get_deleted_objects(
            [self.obj], self.opts, self.request.user, self.admin_site, using)
def init_request ( self , object_id , * args , * * kwargs ) : self . obj = self . get_object ( unquote ( object_id ) ) if not self . has_delete_permission ( self . obj ) : raise PermissionDenied if self . obj is None : raise Http404 ( _ ( '%(name)s object with primary key %(key)r does not exist.' ) % { 'name' : force_text ( self . opts . verbose_name ) , 'key' : escape ( object_id ) } ) using = router . db_for_write ( self . model ) # Populate deleted_objects, a data structure of all related objects that # will also be deleted. ( self . deleted_objects , model_count , self . perms_needed , self . protected ) = get_deleted_objects ( [ self . obj ] , self . opts , self . request . user , self . admin_site , using )