18 Jul
2005
18 Jul
'05
6:12 a.m.
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