[Zope] manage_cutObjects/manage_pasteObjects problem ...
Giampiero Benvenuti
giampiero.benvenuti at chiaroscuro.com
Fri Jul 25 09:20:23 EDT 2008
On Jul 23, 2008, at 7:06 AM, Ajay Deshpande wrote:
> Hi all:
>
> Ive been trying to cut objects from one context and paste them into
> another using a script python. But I get a "CopyError" when I try
> doing this. This is my code snippet and the traceback ...
>
> Snippet...
> ...
> obj = context.restrictedTraverse(path)
> obj_parent = obj.aq_inner.aq_parent
> dest_folder = context.Dest # this is a folder object
> copy_info = obj_parent.manage_cutObjects((context.getId()))
> dest_folder.manage_pasteObjects(copy_info)
> ...
I think the problem is your 4th line: copy_info =
obj_parent.manage_cutObjects((context.getId()))
copy_info should be the object you want to cut
it should be something like this:
...
src=context.your_cut_context[obj_id]
context.your_cut_context.manage_cutObjects([src])
dst=context.your_paste_context
dst.manage_pasteObjects(src)
...
Let me know if it works for you,
Giampiero
More information about the Zope
mailing list