Hi All,

I have an image from a URL that I would like to programatically add to
the newly minted Satchmo product.
I can create File object thus:

from django.core.files import File
import urllib2
from django.core.files.temp import NamedTemporaryFile

    img_temp = NamedTemporaryFile()
    img_temp.write(urllib2.urlopen(url_path).read())
    img_temp.flush()
    file = File(img_temp)

The class ProductImage takes my product instance and has a 'picture'
attr, which is an instance of Satchmo's ImageWithThumbnailField.

So how do I use my File object with the ImageWithThumbnailField model?
It is subclassed from ImageField, but I'm stuck as to what I can
actually do with it!

-- 
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.

Reply via email to