[Zope] zope string question, easy for pythonistas

Joshua Newman lazernewman at yahoo.com
Sat Mar 27 22:58:09 EST 2004


Hi all,

I'm trying to compare an AUTHENTICATED_USER string to a variable which
I named '2nd_smr' in this script to determine if it should be bolded
in a big table and stick out for the user:

<dtml-if "_.string.lower(_.str(
 AUTHENTICATED_USER)) in _.string.lower(_.str(2nd_smr))">
<b>2ndS&nbsp;<dtml-var 2nd_smr  ><br></b><dtml-else>
2ndS&nbsp;<dtml-var 2nd_smr  ><br></dtml-if>

The above script won't save, and gives an error.

The _.string.lower(_.str(2nd_smr)) expression is obviously the culprit
and won't save unless I do ('2nd_smr') which saves but isn't what I
want obviously, and ("2nd_smr") won't save.

Did I screw up by naming a variable with a number as the first
character?

Is is salvageable with some funky syntax like:
_.string.lower(_.str(_['{2nd_smr}']))
or do I have to just change the name of the variable?

Thanks
J




More information about the Zope mailing list