[Zope-dev] Something doesn't seem quite right with CopySupport.py/Moniker.py

Kevin Dangoor kid@kendermedia.com
Tue, 17 Aug 1999 20:01:54 -0400


Hi,

    I posted a couple messages late last week about copying and pasting
objects from DTML and Python... Looking at the source for CopySupport.py, I
don't *think* I should be running into the problem that I am seeing.

Here is my function:
def candp(fobj, tobj):
  "Copy and paste"

  ids = fobj.objectIds()
  if not ids:
    return
  cdata = fobj.manage_copyObjects(ids)
  tobj.manage_pasteObjects(cdata)

The parameters are basically the source object and the destination object.
The DTML that calls this method is passing in a Folder as the source and a
KMArticle as the destination.

cdata is getting set to an encoded string that is roughly 105 bytes in
length. When the manage_pasteObjects call is made, I get an error that the
object is not found.

From manage_pasteObjects in CopySupport.py:

        for j, d in cp[1]:
            m.jar=j
            m.ids=d
            try: ob=m.bind(self._p_jar)
            except: raise CopyError, eNotFound

So, basically it appears that the Moniker object can't bind to the original
object. But, why would this be the case? The copy call was just made on the
previous line, and the data returned by that call seemed valid. I can copy
and paste the objects from the management interface, and the cookie that
gets set looks the same...

Is there something that I'm missing here? I didn't see any big difference
between the management interface calling these routines and my python
calling them...

Thanks,
Kevin