[Zope] Calling superclass methods from inside a Zope object

Marco Bizzarri m.bizzarri at icube.it
Tue Nov 9 06:57:32 EST 2004


-----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-----


More information about the Zope mailing list