I've got a save
method on a model that looks like so:
def save(self, force_insert=False, force_update=False):
img_url = "http://example.com/%s.jpg" % (self.title)
name = urlparse(img_url).path.split('/')[-1]
content = urllib.urlretrieve(img_url)
self.image.save(name, File(open(content[0])), save=True)
super(Test, self).save(force_insert, force_update)
For some reason, this is creating an infinite loop of image creations with ever more _
s in the filename. I finally figured out it was doing that when I got a Django error that said that the file it was trying to save had too many characters (I found 242 images saved).
I was trying to use information from this question.
Any idea what's going on here?