Calling superclass methods from inside a Zope object
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all. We've a problem with a class like this: class MyObject(CatalogPathAware, SimpleItem): ~ def manage_afterAdd(self, item, container): ~ CatalogPathAware.manage_afterAdd(self, item, container) ~ ## other stuff here ## The problem is that MyObject apparentely does not have any visibility of the superclasses methods, if they came from some non Zope class (like the CatalogPathAware, and therefore the manage_afterAdd crashes. Any hint on this? The environment is Zope 2.6.4. Regards Marco -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBkK4SXhfyAQQVoaIRAh2SAKCYGu9IZmJ6aIlZJKyToNZsogF9LwCfVBjJ 29u6eYaHbfSOUGInbIRYmCY= =vOOy -----END PGP SIGNATURE-----
On Nov 9, 2004, at 12:46, Marco Bizzarri wrote:
We've a problem with a class like this:
class MyObject(CatalogPathAware, SimpleItem):
~ def manage_afterAdd(self, item, container): ~ CatalogPathAware.manage_afterAdd(self, item, container) ~ ## other stuff here ##
The problem is that MyObject apparentely does not have any visibility of the superclasses methods, if they came from some non Zope class (like the CatalogPathAware, and therefore the manage_afterAdd crashes.
What you're saying does not make any sense. If there is an error message please post it. jens --------------- Jens Vagelpohl jens@zetwork.com Software Engineer +49-(0)441-36 18 14 38 Zetwork GmbH http://www.zetwork.com/
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jens Vagelpohl wrote: | | On Nov 9, 2004, at 12:46, Marco Bizzarri wrote: | |> We've a problem with a class like this: |> |> class MyObject(CatalogPathAware, SimpleItem): |> |> ~ def manage_afterAdd(self, item, container): |> ~ CatalogPathAware.manage_afterAdd(self, item, container) |> ~ ## other stuff here ## |> |> |> The problem is that MyObject apparentely does not have any visibility of |> the superclasses methods, if they came from some non Zope class (like |> the CatalogPathAware, and therefore the manage_afterAdd crashes. | | | What you're saying does not make any sense. If there is an error message | please post it. | | jens | Jens, thanks for answering. Here is the traceback: Traceback (most recent call last): ~ File "/usr/lib/zope/lib/python/Testing/ZopeTestCase/ZopeTestCase.py", line 109, in setUp ~ self.afterSetUp() ~ File "testSimpleNote.py", line 60, in afterSetUp ~ manage_addCommentNote(self.app, 'aComment', 'title', 'sender', ['someone']) ~ File "/var/local/zope/daniele/Products/EEJNet/SimpleNote.py", line 141, in manage_addCommentNote ~ self._setObject(id, w) ~ File "/usr/lib/zope/lib/python/OFS/ObjectManager.py", line 272, in _setObject ~ object.manage_afterAdd(object, self) ~ File "/var/local/zope/daniele/Products/EEJNet/SimpleNote.py", line 88, in manage_afterAdd ~ CatalogPathAware.manage_afterAdd(self, item, container) TypeError: unbound method manage_afterAdd() must be called with instance as first argument Regards Marco -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBkLCrXhfyAQQVoaIRAuH4AKCaPBH/LE+ibaN7ilPdOacTNydl3gCffY2r X4K33oOGhX+1sN6UhHxVDYY= =hbI8 -----END PGP SIGNATURE-----
TypeError: unbound method manage_afterAdd() must be called with instance as first argument
This mail from the list archives might help: http://mail.zope.org/pipermail/zope/2004-February/146824.html Google is your friend. jens --------------- Jens Vagelpohl jens@zetwork.com Software Engineer +49-(0)441-36 18 14 38 Zetwork GmbH http://www.zetwork.com/
participants (2)
-
Jens Vagelpohl -
Marco Bizzarri