> #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. -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )