[Zope-CMF] Python: trying to copy files

Yuppie schubbe@web.de
Thu, 25 Jul 2002 16:14:05 +0200


Ryan P. de Vega wrote:
> Is 'targetfolder' something I would need to define?  If so, I think this
> is where I have been having my problem all along.  What do I define as the
> targetfolder if for example I want to paste the objects into a folder in
> the ZMI called /CMF/TEST ?  This helps, but I'm not quite there yet?
> 
> Thanks!
> Ryan
> 
> schubbe@web.de writes:
> 
>>Did you try this?
>>
>>tmpObj = context.manage_copyObjects(REQUEST['ids'])
>>context.portal_url.getPortalObject().targetfolder.manage_pasteObjects(tmpObj)

CMF seems to be your site root, you get it using 
context.portal_url.getPortalObject()

TEST is your target folder

This should work for you:
context.portal_url.getPortalObject().TEST.manage_pasteObjects(tmpObj)

Yuppie