def delete(self, *args, **kwargs): # Delete any thumbnails too (and not just ones defined here in case # the {% thumbnail %} tag was used or the thumbnail sizes changed). relative_source_path = getattr(self.instance, self.field.name).name self.thumbnail.delete() if self.extra_thumbnails: for extra_thumbnail_name in self.extra_thumbnails: self.extra_thumbnails[extra_thumbnail_name].delete() delete_thumbnails(relative_source_path) super(BaseThumbnailFieldFile, self).delete(*args, **kwargs)
def delete(self, *args, **kwargs): # Delete any thumbnails too (and not just ones defined here in case # the {% thumbnail %} tag was used or the thumbnail sizes changed). relative_source_path = getattr(self.instance, self.field.name).name delete_thumbnails(relative_source_path) super(BaseThumbnailFieldFile, self).delete(*args, **kwargs)
def delete(self, save=True): # Delete any thumbnails too (and not just ones defined here in case # the {% thumbnail %} tag was used or the thumbnail sizes changed). relative_source_path = getattr(self.instance, self.field.name).name delete_thumbnails(relative_source_path) super(ImageWithThumbnailsFieldFile, self).delete(save)
def delete(self): delete_thumbnails(getattr(self, self.image_field)) models.Model.delete(self)