[Zope] Python in expressions

Phil Harris phil.harris@zope.co.uk
Fri, 12 Nov 1999 23:55:24 -0000


Hi Clarence

Try
<dtml-if "_.math.divmod(33,2) == 1"> a </dtml-if>




----- Original Message ----- 
From: Clarence Gardner <clarence@netlojix.com>
To: <zope@zope.org>
Sent: Friday, November 12, 1999 11:00 PM
Subject: [Zope] Python in expressions


> 
> Hello, it's my first day with Zope!
> 
> I'm trying to do a simple Python expression, e.g.,
> 
>     <dtml-if "divmod(33,2) == 1"> a </dtml-if>
> 
> I get a NameError.  I was given to understand that double-quoted
> expressions are normal Python expressions, and divmod is a builtin,
> so there shouldn't be a problem.
> 
> Just for the heck of it, after that error, I tried
> 
>     <dtml-if "_.has_key('divmod')">
> 
> which evaluated to false.
> 
> 
> Am I missing something simple here?
> 
> Thanks
> 
> -=-=-=-=-=-=-=-=
> Clarence Gardner
> Software Engineer
> NetLojix Communications, Inc.    NASDAQ:NETX
> clarence@netlojix.com
> 
> _______________________________________________
> 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 )
>