On 10/15/2010 9:01 PM, Devin M wrote:
> Hello everyone,
>     I am writing a save handler in my models.py file to run a few
> actions after a save. to do this I have a function called make_photos
> and a connection to the post_save signal.
> Here is my code:
>
> <deleted text>
> The only problem i have with this code is that it runs every save. So
> it creates a infinite loop of sorts and I dont know how to make it
> perform this action once. Is there another signal I should use? Any
> ideas?
>
> Regards,
> Devin M
>
You may want to look at this:
http://snipt.net/danfreak/generate-thumbnails-in-django-with-pil/

The snippet above overrides the save method.  Before calling the actual
save (super), the thumbnail fields is dynamically created (using PIL). 
I am sure you can add code that will do the same thing for your "large"
photo field.


regards,
Blue C

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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