示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 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)
示例#4
0
 def delete(self):
     delete_thumbnails(getattr(self, self.image_field))
     models.Model.delete(self)
示例#5
0
 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)