[Zope] aquiring objects upward in DTML

Dieter Maurer dieter@handshake.de
Mon, 19 Aug 2002 21:49:25 +0200


Dan Jacobs writes:
 > Is there an easy way within a DTML method to acquire a named object that
 > may be anywhere upward.
 > 
 > At the moment I'm looking at the parent by doing
 > aq_parent['name']
 > but that only looks one level up.
You may try:

    "getattr(aq_parent,name)"

It starts at "aq_parent" looking for "name" and, if unsuccessful,
uses acquisition to resolve "name".


Dieter