Re: Detection of "tainted" fields

2007-01-18 Thread Vasily Sulatskov
I use something like: class MyModel(models.Model): mypic = models.ImageField() def __init__(self, *args, **kwds): super(MyModel, self).__init__(*args, **kwds) self.mypic_org = self.mypic def save(self): if self.mypic != self.mypic_org: # do some work be

Detection of "tainted" fields

2007-01-16 Thread Martin Winkler
Hi all, I need to check if a certain field in my model has changed before saving: -- model MyModel(models.Model): mypic = models.ImageField() def save(self): if self.mypic.tainted: # do some work because the image has changed super(MyModel, self).save() -- So I o