Hi,

I have this app which has an ImageField, where the image needs to be
cropped, resized, and a few effects (all from PIL) are applied on it, the
model looks something like this

class MidPanel(models.Model):
    ....
   .....
   image = models.ImageField(upload_to="images"):

   def save(self):
         ........
        if self.image:
           dosomething(self.image)


Everything is fine, expect that every time someone makes a change to a field
in the model, the images gets manipulated. The image manipulation is
supposed to happen only once.

What I want is somehow to apply the cmanipulation  on self.image only if the
image is changed, or its been created... Is pre_seave the right way, if so
how do you actually use it where it need to compare previosly stored data
and the newone and then only execute.

Ramdas



-- 
Ramdas S
+91 9342 583 065

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to