code: def delete_view(self, request, object_id, extra_context=None):
          
          parent_folder = None
          try:
              obj = self.get_queryset(request).get(pk=unquote(object_id))
              parent_folder = obj.folder
          except self.model.DoesNotExist:
              obj = None
  
          r = super(FileAdmin, self).delete_view(
              request=request, object_id=object_id,
              extra_context=extra_context)
  
          url = r.get("Location", None)
  
          # Check against filer_file_changelist as file deletion is always made by
          # the base class
          if (url in ["../../../../", "../../"] or
                  url == reverse("admin:media_file_changelist") or
                  url == reverse("admin:media_image_changelist")):
              if parent_folder:
                  url = reverse('admin:filer-directory_listing',
                                kwargs={'folder_id': parent_folder.id})
              else:
                  url = reverse('admin:filer-directory_listing-unfiled_images')
              url = "%s%s%s" % (url, popup_param(request),
                                selectfolder_param(request, "&"))
              return HttpResponseRedirect(url)
          return r
docs: Overrides the default to enable redirecting to the directory view after
          deletion of a image.
  
          we need to fetch the object and find out who the parent is
          before super, because super will delete the object and make it
          impossible to find out the parent folder to redirect to.