15 Mar
2004
15 Mar
'04
10:41 a.m.
Dear Zopers Is it the case that it is not possible to make use of hasattr within a tal:condition statement? In a ZPT I need to test whether an attribute of here/request is set or not. Unfortunately, this raises an exception, which is exactly what I want to prevent... Here is what the test looks like: <span tal:condition="python:test(hasattr(request, results), 1, 0)">span</span> Is there a better way to achieve the same? thanks and regards Andre PS in the full version the statement looks as follows: <body tal:define="results python:test(hasattr(request, results), request.results, here.Catalog()); ... >