Re: pre-save and check for existing value of image

2009-11-10 Thread ankit rai
you self.instance.fieldname use this ur from . On Tue, Nov 10, 2009 at 12:58 PM, Ramdas S wrote: > 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

pre-save and check for existing value of image

2009-11-09 Thread Ramdas S
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):

Re: pre-save and check for existing value of image

2009-11-09 Thread ankit rai
You can check whether there is instance or not by self.instance .This will tell u that whether it is change (page)or a new object is added.And if it new object then only call ur custom functions.U can also use changeForm function On Tue, Nov 10, 2009 at 12:39 PM, Ramdas S

pre-save and check for existing value of image

2009-11-09 Thread Ramdas S
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="imgs") def save(self):