[Zope] Cut and paste from python code

Bocquillon Philippe Philippe.Bocquillon@trasys.be
Thu, 23 Aug 2001 14:37:07 +0200


Hello,

I am trying to cut and paste objects from python code. Both origin and
destination container objects are inheriting from ObjectManager.
I am using the following code to cut objects contained in self and copy them
in the newChannel object:

        if len(self.objectIds()) != 0:
            cp = self.manage_cutObjects(self.objectIds()) 
            newChannel.manage_pasteObjects(cp)

An error is raised:

Error Type: TypeError
Error Value: call of non-function (type string)

<!--
Traceback (innermost last):
  File
P:\Ifs\Eop\DI783\DI783\DGENTR~1\CHANNE~1\ZOPE-2~2.3-W\lib\python\ZPublisher\
Publish.py, line 223, in publish_module
  File
P:\Ifs\Eop\DI783\DI783\DGENTR~1\CHANNE~1\ZOPE-2~2.3-W\lib\python\ZPublisher\
Publish.py, line 187, in publish
  File
P:\Ifs\Eop\DI783\DI783\DGENTR~1\CHANNE~1\ZOPE-2~2.3-W\lib\python\Zope\__init
__.py, line 221, in zpublisher_exception_hook
    (Object: Traversable)
  File
P:\Ifs\Eop\DI783\DI783\DGENTR~1\CHANNE~1\ZOPE-2~2.3-W\lib\python\ZPublisher\
Publish.py, line 171, in publish
  File
P:\Ifs\Eop\DI783\DI783\DGENTR~1\CHANNE~1\ZOPE-2~2.3-W\lib\python\ZPublisher\
mapply.py, line 160, in mapply
    (Object: manage_publishProposedChannel)
  File
P:\Ifs\Eop\DI783\DI783\DGENTR~1\CHANNE~1\ZOPE-2~2.3-W\lib\python\ZPublisher\
Publish.py, line 112, in call_object
    (Object: manage_publishProposedChannel)
  File
P:\Ifs\Eop\DI783\DI783\DGENTR~1\CHANNE~1\ZOPE-2~2.3-W\lib\python\Products\Co
llaboratingPortals\ProposedChannel.py, line 114, in
manage_publishProposedChannel
    (Object: Traversable)
  File
P:\Ifs\Eop\DI783\DI783\DGENTR~1\CHANNE~1\ZOPE-2~2.3-W\lib\python\OFS\CopySup
port.py, line 210, in manage_pasteObjects
    (Object: Traversable)
TypeError: (see above)

-->

The line 210 referenced in the trace in the CopySupport.py Zope 2.3.3 module
is:

        app = self.getPhysicalRoot()

Do you have any idea of why this error occurs?
Is anybody else using other methods to copy/paste objects from a container
object to another?

Thanks in advance,

Philippe Bocquillon