[Zope] Rendering files with exception

Dieter Maurer dieter@handshake.de
Fri, 5 Jul 2002 22:38:09 +0200


Jaroslav Lukesh writes:
 > ...
 > | The following code is not completely safe but may be sufficient
 > | for your purposes:
 > | 
 > |     <dtml-if "_.hasattr(aq_explicit,'index.htm')">
 > |       <dtml-var index.htm>
 > |     <dtml-else>....
 > |     </dtml-if>
 > 
 > Absolutelly sufficient and works :)
 > 
 > Why it is not completely safe?
It restricts acquisition somewhat but not completely.

Please read the "Acquistion" section for "explicite acquisition" in

  <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html>

"aq_explicit" returns an explicit acquisition wrapper for an
implicit one. Explicit acquisition wrappers still acquire
when "aq_self" is itself a wrapped object.


Dieter