You do it better (it looks more pythonic) then I did it sometimes. I remember it was important only to save the file to the right place and save the path to the database similarly as path saved by /admin/. I hope it is not complicated for you if you verify if step by step. I need not understand what ImageWithThumbnailField does for it.
You did not assigned anything to "picture" field yet !! On 7 pro, 02:28, Tomas Neme <[email protected]> wrote: > Hello.. I'm scraping a store, and I have the URL of the pictures for my > products, but I'm not being able to create the ProductImage objects for it. > I cannot understand it completely. > > Can someone give me a hand with this, please? > > I've got this that I got somewhere (I don't remember) but it's throwing > that that save kwarg isn't valid, and I'm not being able to make this work > > image = ProductImage( > product=product,) > url = item['image_url'] > name = urlparse(url).path.split('/')[-1] > image.save(name, File(urllib2.urlopen(url).read(), save=True)) > > Thanks > Tomas > > -- > "The whole of Japan is pure invention. There is no such country, there are > no such people" --Oscar Wilde > > |_|0|_| > |_|_|0| > |0|0|0| > > (\__/) > (='.'=)This is Bunny. Copy and paste bunny > (")_(") to help him gain world domination. -- You received this message because you are subscribed to the Google Groups "Satchmo 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/satchmo-users?hl=en.
