[Zope] Creating Photo object from an Image object

Peter Bengtsson peterbe at gmail.com
Sun Jul 17 11:00:10 EDT 2005


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


More information about the Zope mailing list