[Zope] A ZPT newbie question

Paul Winkler pw_lists@slinkp.com
Tue, 5 Nov 2002 10:30:34 -0800


On Tue, Nov 05, 2002 at 02:08:42PM +0100, Clemens Robbenhaar wrote:
>  > The following gives an attribute error if 'this_object' is None:
>  > 
>  >     <span tal:replace="python: test(this_object is not None,
>  > this_object.getSomethingBig(), '')" />
>  >         
>  > test() seems to always evaluate both params no matter what. 


What's wrong with the usual python idiom?

   <span tal:replace="python: (foo is not None and foo.bar()) or ''">
   </span>

-- 

Paul Winkler
http://www.slinkp.com
"Welcome to Muppet Labs, where the future is made - today!"