[Zope] Bag 'o newbie questions

Michael S. Fischer michael@dynamine.net
Fri, 16 Aug 2002 14:46:09 -0700


On Fri, Aug 16, 2002 at 02:28:28PM -0700, Michael S. Fischer wrote:

> I really wanted to write something like this, but I couldn't get it
> to work:
> 
> <span tal:define="object python:test(hasattr(container.aq_explicit, 
>                                               'content_html'), 
>                                           content_html, toc_html)"
>       tal:replace="structure object">
> </span>
> 
> Apparently the test() function actually tries to evaluate the (possibly
> non-existing) content_html object even if the hasattr() returns 0.
> 
> Any thoughts?

I'm still interested in the answer to the above question, but I found
out this works just fine:

<span tal:replace="structure here/aq_explicit/default_html | toc_html">
</span>

-- 
Michael S. Fischer / michael at dynamine.net / +1 650-533-4684
Lead Hacketeer, Dynamine Consulting, Silicon Valley, CA