16 Mar
2004
16 Mar
'04
9:20 a.m.
Andre Meyer wrote:
<span tal:condition="python:test(hasattr(request, results), 1, 0)">span</span>
using hasattr in any Zope-ish python is BAD, since it ignores all exceptions, including things like ConflictErrors, which you NEVER want to catch...
PS in the full version the statement looks as follows:
<body tal:define="results python:test(hasattr(request, results), request.results, here.Catalog()); ... >
<body tal:define="results getattr(request,'results',here.Catalog()); ... > cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk