[Zope] Cut and paste from python code
Dieter Maurer
dieter@handshake.de
Thu, 23 Aug 2001 22:03:30 +0200 (CEST)
Bocquillon Philippe writes:
> 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)
> ....
> 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()
Seems as if "newChannel" had overridden "getPhysicalRoot"
and it would now be a string.
I would use the fact that Zope is Open Source and add a
print statement before line 210 to see what "getPhysicalRoot"
is. This may give a hint where something goes wrong.
Dieter