[Zope-CMF] Python: trying to copy files

Yuppie schubbe@web.de
Thu, 25 Jul 2002 10:09:46 +0200


Ryan P. de Vega wrote:
> ---Goal---
> When someone clicks on a portal button (something like 'copy' in
> folder_contents), selected (selected via checkboxes so far) objects are
> copied and pasted into another folder in the ZMI - but not the within the
> 'Members' folder.
> 
> ---Progress---
> I can get the selected objects to copy into the logged-on member's folder
> (within the ZMI 'Members' folder), but not into a specified folder in my
> "CMF Test Site" ZMI or CMF root.
> 
> ---Problem---
> I can't figure out how to put files into a Zope folder from the CMF -
> using python.  Any ideas on what the syntax would be for this task? 
> Anything would help - I'm dead in the water.

Did you try this?

tmpObj = context.manage_copyObjects(REQUEST['ids'])
context.portal_url.getPortalObject().targetfolder.manage_pasteObjects(tmpObj)

Yuppie