[Zope] Problems with manage_afterAdd in Python Product

Peter Sabaini sabaini@inode.at
Fri, 11 Apr 2003 07:45:29 +0200


This is a cryptographically signed message in MIME format.

--------------ms040104060200080703000409
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Sven Rudolph wrote:
> Hello all,
> 
> I have written a small product called MyProduct:
> 
> MyProduct(CatalogAware,Implicit,Persistent,RoleManager,PropertyManager,ObjectManager,Item,Historical,Folder):
>  """ """
>  ...(etc.)
> 
> 
> 
> 
> Every time I try to copy&paste, cut&paste an instance of this product I get
> Error Type: AttributeError
> Error Value: manage_afterAdd
> 
> 
> 
> The traceback is: 
> Traceback (innermost last):
>   File /home/medizin/zope/zope-2.5.1/lib/python/ZPublisher/Publish.py, line 150, in publish_module
>   File /home/medizin/zope/zope-2.5.1/lib/python/ZPublisher/Publish.py, line 114, in publish
>   File /home/medizin/zope/zope-2.5.1/lib/python/Zope/__init__.py, line 159, in zpublisher_exception_hook
>     (Object: home2)
>   File /home/medizin/zope/zope-2.5.1/lib/python/ZPublisher/Publish.py, line 98, in publish
>   File /home/medizin/zope/zope-2.5.1/lib/python/ZPublisher/mapply.py, line 88, in mapply
>     (Object: manage_pasteObjects)
>   File /home/medizin/zope/zope-2.5.1/lib/python/ZPublisher/Publish.py, line 39, in call_object
>     (Object: manage_pasteObjects)
>   File /home/medizin/zope/zope-2.5.1/lib/python/OFS/CopySupport.py, line 160, in manage_pasteObjects
>     (Object: home2)
>   File /home/medizin/zope/zope-2.5.1/lib/python/OFS/ObjectManager.py, line 267, in _setObject
>     (Object: home2)
>   File /home/medizin/zope/zope-2.5.1/lib/python/Products/ZCatalog/CatalogAwareness.py, line 46, in manage_afterAdd
>   File /home/medizin/zope/zope-2.5.1/lib/python/Products/ZCatalog/CatalogAwareness.py, line 46, in manage_afterAdd


BTW. also note that CatalogAwareness.CatalogAware is deprecated, you 
should be using CatalogPathAwareness.CatalogAware

  - peter.



> AttributeError: (see above)
> 
> 
> I understand that this error has something to do with inheriting from CatalogAware. manage_afterAdd is called after paste so the object can tell its default_catalog about its new path I belive.
> 
> Since I don't need manage_afterAdd I tried to overwrite it:
> def manage_afterAd():
>  """ """
>  pass
> 
> But the error persits...
> 
> 
> Can anybody tell me how to solve this problem, or point me to some documentation?
> 
> Many, many thanks in advance :-)
> 
> 
> Greetings
> Sven
> 
> 
> 

--------------ms040104060200080703000409
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIJcjCC
AxcwggKAoAMCAQICAwlZhTANBgkqhkiG9w0BAQQFADCBkjELMAkGA1UEBhMCWkExFTATBgNV
BAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMQ8wDQYDVQQKEwZUaGF3dGUx
HTAbBgNVBAsTFENlcnRpZmljYXRlIFNlcnZpY2VzMSgwJgYDVQQDEx9QZXJzb25hbCBGcmVl
bWFpbCBSU0EgMjAwMC44LjMwMB4XDTAzMDIyMTEzMTY0NloXDTA0MDIyMTEzMTY0NlowWzEQ
MA4GA1UEBBMHU2FiYWluaTEOMAwGA1UEKhMFUGV0ZXIxFjAUBgNVBAMTDVBldGVyIFNhYmFp
bmkxHzAdBgkqhkiG9w0BCQEWEHNhYmFpbmlAaW5vZGUuYXQwggEiMA0GCSqGSIb3DQEBAQUA
A4IBDwAwggEKAoIBAQC1XhEfxugiGePyj2dxvgshFABfJw+Zcfar1FrGEdmCiMdEQO8kOpfZ
6NgSFe3nxMi4wsDR6LlnW1gEKYe0FVOf8T41naNlgAoz507xmm9X0QFo+lUiz00lZyiETHLS
pniVk2Ds9NnZeOwbkYLekXj1QXy2MChGfzavpXzI+Zl+XYojMtnEJEDYUiL/gwEDxMSE/KnA
yMx3R0vVeXCNKA3dM3il50QjNyE0XAV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