Re: [Zope] Rendering files with exception
| OdesÃlatel: Dieter Maurer <dieter@handshake.de> | It seems that you would like to render "index.htm" if it exists | in the current folder and do something else, otherwise. Yes, but it is in my initial question. I am sorry, but I need to learn english more (I know low word count). | 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? Many thanks, Jaroslav Lukesh
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
participants (2)
-
Dieter Maurer -
Jaroslav Lukesh