[Zope] Introspection and Zope
Dieter Maurer
dieter@handshake.de
Tue, 27 Nov 2001 22:10:41 +0100
Douwe Osinga writes:
> ....
> 05 return context[propname]()
> ....
> Now, if I pass 'absolute_url' as propname, this works as a dream. But if I
> pass getParent, a
> method I created in the base class of the object where context was derived
> from, the thing
> crashes with 'Resource not found'.
You mix attribute access syntax and subscription syntax.
I do not know why it works for "absolute_url" but it is not a good
idea in general.
Try: "getattr(context,propname)()"
Dieter