Just a quick idea off the top of my head before going to bed :)
def save(self, *args, **kwargs):
super(MyModel, self).save(*args, **kwargs) # Call the "real"
save() method.
timestamp = os.path.getmtime(self.my_image_field.path)
if datetime.datetime.now() - timestamp < VERY_SMALL_DELTA:
process_image(self.my_image_field.path)
On Mar 9, 10:15 am, Xavier Ordoquy <[email protected]> wrote:
> Hi,
>
> I have a class with an image field.
> Every time the image is changed, I need to resize the image to several
> formats.
> At the moment, I do that every time the class which contains the image is
> saved.
> However, I'd like to improve that a bit and only resize whenever the image
> has changed.
>
> Is there any way to do that easily with Django 1.1 ?
>
> Regards,
> Xavier.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.