[Zope] Creating Photo object from an Image object

Thomas Adams thomas.adams at onlinehome.de
Mon Jul 18 02:12:02 EDT 2005


Peter Bengtsson schrieb:

>>#id1,title1  image id and  tile
>>def doAddPhoto(id1, title1):
>>    # some comments
>>    ....
>>
>>    img = context.getObjectById(id1) # this returns the object part of
>>object item array from context.objectItems
>>    s="ph" +str(id1)
>>    context.manage_addPhoto(id=s, file=img.data,title=title1,
>>displays=None, precondition='', content_type='image/jpeg') (line 12)
>>    
>>
>
>It should be:
>product_context = context.manage_addProduct['Photo']
>product_context.manage_addPhoto(id=s, ......)
>
>Not so obvious to know :(
>You can get hints like this by viewing the source of any ZMI page that
>has the Add object drop down.
>
>
>  
>
Thanks, that works,

but in addition there is an photo.manage_upload(file=img.data) necessary 
too see the images.

Regards
Thomas Adams



-------------- next part --------------
A non-text attachment was scrubbed...
Name: thomas.adams.vcf
Type: text/x-vcard
Size: 239 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20050718/ad9650be/thomas.adams.vcf


More information about the Zope mailing list