Ah nice, I tried something like that, but I used self.width instead of
doing an actual get on the model.  Works fine now, thanks :)

-Vincent

On Apr 26, 10:28 am, "Mike H" <[EMAIL PROTECTED]> wrote:
> Hi Vincent,
>
> It sounds to me like you need a pre_save signal to check if the width
> and/or height of the model you're about to save is different from the
> one currently stored in the database, and if they are different,
> regenerate the thumbnail.
>
> Something like :
>
>     in_db = Model.objects.get(pk=self.id)
>     if in_db.width is not self.width
>         ....
>
> (if I've understood pre_save correctly, that is. I override the save
> method, myself.)
>
> Hope that helps,
>
> Mike
>
> On 4/26/2007, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
>
>
> >Hello,
>
> >I have a small photo gallery application.  My model has two classes,
> >Gallery and Photo.  Gallery contains information on the width and
> >height of the thumbnails of its photos.  I added a post_save signal so
> >that when a Gallery object is saved, all the photo thumbnails are
> >recreated to match the specified width and height.  This means that
> >changing information unrelated to the thumbnails recreates them.
>
> >I would like to know if it's possible to find which fields have been
> >update so that I could resize the thumbnails only when the width or
> >height attributes have been changed.  Is that possible?
>
> >-Vincent


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to