예제 #1
0
파일: fields.py 프로젝트: modamania/otdohni
 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)