[Zope] Testing multiple values for existance

marc lindahl marc@bowery.com
Thu, 20 Sep 2001 14:10:35 -0400


Try testing for existence first -- hasattr()

> From: Oliver Sturm <sturm@oliver-sturm.de>
> Date: Thu, 20 Sep 2001 19:45:41 +0200
> To: "zope@zope.org" <zope@zope.org>
> Subject: [Zope] Testing multiple values for existance
> 
> Hi!
> 
> I can do <dtml-if foo> to test if foo is known at all. Why can't I do
> <dtml-if "foo or bar"> to test if either foo or bar are known? I get a
> "Name Error" saying something like "global name 'foo' is not defined" if I
> do this (and foo is actually undefined). Is there a different syntax for
> this?
> 
> 
> Oliver Sturm / <sturm@oliver-sturm.de>
> 
> -- 
> Key ID: 71D86996
> Fingerprint: 8085 5C52 60B8 EFBD DAD0  78B8 CE7F 38D7 71D8 6996
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )