def save(self, *args, **kwargs): dirty_fields = self.get_dirty_fields() super().save(*args, **kwargs) if 'photo' in dirty_fields and self.photo: optimize_jpeg(self.photo)
def save(self, *args, **kwargs): dirty_fields = self.get_dirty_fields() super().save(*args, **kwargs) if 'image' in dirty_fields and self.image: optimize_jpeg(self.image)
def save(self, *args, **kwargs): dirty_fields = self.get_dirty_fields() geodata_changed = list_intersect(dirty_fields.keys(), ['name', 'address', 'city', 'state', 'postal_code']) if geodata_changed: self.geocode() super().save(*args, **kwargs) if 'listing_image' in dirty_fields and self.listing_image: optimize_jpeg(self.listing_image)