code: def delete_file(self, instance, sender, **kwargs):
          
          file_ = getattr(instance, self.attname)
  
          # If no other object of this type references the file, and it's not the
          # default value for future objects, delete it from the backend.
          query = Q(**{self.name: file_.name}) & ~Q(pk=instance.pk)
          qs = sender._default_manager.filter(query)
  
          if (file_ and file_.name != self.default and not qs):
              default.backend.delete(file_)
          elif file_:
              # Otherwise, just close the file, so it doesn't tie up resources.
              file_.close()
docs: Adds deletion of thumbnails and key value store references to the
          parent class implementation. Only called in Django < 1.2.5