Can't paste CatalogAware object
I have a ZClass that inherits (indirectly thorugh a python class) from CatalogAware. I cut an instance, then paste it. I get the following error (2.1.0 and 2.1.1): Error Type: AttributeError Error Value: aq_acquire Traceback (innermost last): ... File /home/zope/lib/python/OFS/CopySupport.py, line 225, in manage_pasteObjects (Object: CatalogAware) File /home/zope/lib/python/OFS/ObjectManager.py, line 267, in _delObject (Object: ElementWithAttributes) File /home/zope/lib/python/Products/ZCatalog/CatalogAwareness.py, line 129, in manage_beforeDelete (Object: CatalogAware) File /home/zope/lib/python/Products/ZCatalog/CatalogAwareness.py, line 186, in unindex_object (Object: CatalogAware) File /home/zope/lib/python/Products/ZCatalog/CatalogAwareness.py, line 156, in url (Object: CatalogAware) File /home/zope/lib/python/OFS/SimpleItem.py, line 315, in absolute_url (Object: CatalogAware) File /home/zope/lib/python/OFS/SimpleItem.py, line 315, in absolute_url (Object: ElementWithAttributes) File /home/zope/lib/python/OFS/Application.py, line 282, in absolute_url (Object: ApplicationDefaultPermissions) AttributeError: (see above) -- Itamar S.T. itamars@ibm.net
Itamar Shtull-Trauring wrote:
I have a ZClass that inherits (indirectly thorugh a python class) from CatalogAware.
I cut an instance, then paste it. I get the following error (2.1.0 and 2.1.1):
Error Type: AttributeError Error Value: aq_acquire
So I implemented absolute_url in my python base class with the call to aq_parent.absolute_url done with relative=1 instead of just passing relative. Why does OFS.Application.Application call aq_acquire if it doesn't inherit from Acquisiton.Explicit? This solves this problem, but I get another one. In CatalogAwareness, in the url function, there is a call to self.REQUEST['SCRIPT_NAME'] - but I get an error saying REQUEST doesn't exist. How the hell does Zope decide when you have access to self.REQUEST and when you don't? I can't seem to find any way to tell when it'll work or not. -- Itamar S.T. itamars@ibm.net
participants (1)
-
Itamar Shtull-Trauring