[Zope] cut and paste or an object

Terry Kerr terry@adroit.net
Tue, 11 Jul 2000 19:10:33 +1000


Hi,

I have written a product in python which has two classes.  One is a
contrainer class, and the other as an item.  Both classes are
catalogAware.  Both have management interfaces which allow
cut/copy/paste.  Copy and paste works fine.  But if I paste an object
that has been cut, i get the error:

Traceback (innermost last):
    File /home/tejay/Zope-2.1.6-src/lib/python/ZPublisher/Publish.py,
line 214, in publish_module
    File /home/tejay/Zope-2.1.6-src/lib/python/ZPublisher/Publish.py,
line 179, in publish
    File /home/tejay/Zope-2.1.6-src/lib/python/Zope/__init__.py, line
202, in zpublisher_exception_hook
      (Object: RoleManager)
    File /home/tejay/Zope-2.1.6-src/lib/python/ZPublisher/Publish.py,
line 165, in publish
    File /home/tejay/Zope-2.1.6-src/lib/python/ZPublisher/mapply.py,
line 160, in mapply
      (Object: manage_pasteObjects)
    File /home/tejay/Zope-2.1.6-src/lib/python/ZPublisher/Publish.py,
line 102, in call_object
      (Object: manage_pasteObjects)
    File /home/tejay/Zope/lib/python/OFS/CopySupport.py, line 225, in
manage_pasteObjects
      (Object: RoleManager)
    File /home/tejay/Zope-2.1.6-src/lib/python/OFS/ObjectManager.py,
line 273, in _delObject
      (Object: RoleManager)
    File
/home/tejay/Zope-2.1.6-src/lib/python/Products/ZCatalog/CatalogAwareness.py,
line 129, in manage_beforeDelete
      (Object: CatalogAware)
    File
/home/tejay/Zope-2.1.6-src/lib/python/Products/ZCatalog/CatalogAwareness.py,
line 186, in unindex_object
      (Object: CatalogAware)
    File
/home/tejay/Zope-2.1.6-src/lib/python/Products/ZCatalog/CatalogAwareness.py,
line 156, in url
      (Object: CatalogAware)
    File /home/tejay/Zope-2.1.6-src/lib/python/OFS/SimpleItem.py, line
319, in absolute_url
      (Object: CatalogAware)
    File /home/tejay/Zope-2.1.6-src/lib/python/OFS/SimpleItem.py, line
319, in absolute_url
      (Object: RoleManager)
    File /home/tejay/Zope-2.1.6-src/lib/python/OFS/SimpleItem.py, line
319, in absolute_url
      (Object: ElementWithAttributes)
    File /home/tejay/Zope/lib/python/OFS/Application.py, line 282, in
absolute_url
      (Object: ApplicationDefaultPermissions)
  AttributeError: aq_acquire

The only difference between cutnpast and copynpaste is that cutnpaste
will remove the object before setting the new object.  The problem seems
to lie in obtaining the absolute_url of the object to be removed which
is need by CatalogAware to unindex the object.  I dont understand this,
as a direct call to _delObject() from the contrainer class works fine,
so I don't understand why a call to _delObject from within the
manage_pastObjects method results in the above error.

I have been trying to figure this out for days.  Can anyone shead any
light on the subject?

terry



--
Terry Kerr (terry@adroit.net)
Adroit Internet Solutions Pty Ltd (www.adroit.net)
Phone:   +613 9563 4461
Fax:     +613 9563 3856
Mobile:  +61 414 938 124
ICQ:     79303381