I have a model that looks like this:
class ProjectImage(models.Model):
project = models.ForeignKey(Project)
in_slideshow = models.BooleanField(default=False)
large_thumb = ImageWithThumbnailsField(
upload_to='projects',
thumbnail={'size': (500, 384), 'options': ['crop']},
generate_on_save=True,
)
medium_thumb = ImageWithThumbnailsField(
upload_to='projects',
thumbnail={'size': (107, 107), 'options': ['crop']},
generate_on_save=True,
blank=True,
)
small_thumb = ImageWithThumbnailsField(
upload_to='projects',
thumbnail={'size': (68, 68), 'options': ['crop']},
generate_on_save=True,
blank=True,
)
def save(self, force_insert=False, force_update=False):
if self.medium_thumb is None:
self.medium_thumb = self.large_thumb
if self.small_thumb is None:
self.small_thumb = self.medium_thumb
super(ProjectImage, self).save(force_insert, force_update)
However, when I save without putting in anything for medium or small thumb, the code (as I expect it) does not provide the medium / small thumbs with the same file as the large thumb.
Thanks in advance