David Christiansen wrote:
> The idea is that image_scaled has a version that is a thumbnail of the
> originally updated photo. I've removed that code for testing
> purposes, and this still happens. What happens is that two images are
> created in content_images/page/PAGE_ID/scaled/, one with an underscore
> after the name. image_scaled.path shows that the version with the
> extra underscore is the current one referred to after running this.
>
> This behavior happens on both Windows and Linux servers. I'm running
> Django 1.0. As far as I can tell, I'm using the FileField API
> correctly. Is there something obvious that I'm missing?
>
> Thanks in advance!
I had a similar issue.
The fix i have found on the web is to wrap your action in an if
statement to make sure you only do it once
Something like
def save(self):
if not image_scaled:
scaled_name = os.path.split(self.image_original.name)[-1]
self.image_scaled.save(scaled_name, self.image_original,
save=False)
super(Page, self).save()
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---