How do I use the value of other model fields in some field? I want to resize an image to the width and height specified in their respective fields:
class MyImage(models.Model):
name = models.CharField(max_length=128, blank=False)
width = models.PositiveIntegerField(blank=False) #--->
height = models.PositiveIntegerField(blank=False) #--->
new_image = ProcessedImageField(processors=[ResizeToFill(500, 500)], #<---
format='JPEG',
options={'quality': 60})
I have to to swap first 500 into value from variable width and and second 500 into variable height. The field ProcessedImageField is from a package django-imagekit that I am using.