29 May
2001
29 May
'01
8:12 a.m.
What was wrong with if hasattr(context,'coffeebreak'): print "have coffee" ?
This is almost the equivalent of DTML's <dtml-if coffeebreak>
Not really... the DTML equivalent would be: <dtml-if "hasattr(context,'coffeebreak')"> ...which is something quite different ;-)
In a python script, bind the namespace to _ on the bindings tab and then see what happens with:
if _['coffeebreak']: print 'coffee'
The purpose of the Script bit is to check for the presence of an object OR property, isn't it?
cheers,
Chris