28 May
2001
28 May
'01
5:53 p.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' cheers, Chris