[Zope] Aquisition and supermethod calls

Dieter Maurer dieter@handshake.de
Mon, 11 Feb 2002 21:16:13 +0100


Daniel Mahler writes:
 > I was wonder how one should do an analog
 > of supermethod calls for aquisition.
 > For example I may want the index_html
 > in some folder to wrap some information
 > around the aquired index_html.
 > I have come up with the incantation
 > 
 > +++++ index_html ++++
 > some added stuff
 > <dtml-var "PARENTS[1].index_html(this(),REQUEST,RESPONSE)">
 > some more added stuff
 > ++++++++++++++++++++++
There are two problems:

  1. Usually, it is not easy to get a hold on the executing DTML method.
     You may be lucky in special cases, i.e. when it is
     "REQUEST.PUBLISHED".

  2. When you can access the object "o", you can use "o.aq_inner.aq_parent"
     (this is the equivalent of "container(o)" to go up one
     step towards to root (you must go up twice!).

     Unfortunately, "aq_inner" is not exposed to DTML/Python Scripts
     (don't know why, its just the case). Therefore, you must use
     this in an External Method or other file system based code.


Dieter