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
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Clarence Gardner Sent: Friday, November 12, 1999 15:01 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,
Just for the challenge, I tried this out: <dtml-var "_.divmod(33,2)"> It returns a tuple (16, 1) -- Loren
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 )
participants (3)
-
Clarence Gardner -
Loren Stafford -
Phil Harris