[Zope] Assigning strings using DTML-LET

Shalabh Chaturvedi shalabh@pspl.co.in
Fri, 31 Mar 2000 16:42:05 +0530


Jason Wong wrote:
>
> I'm trying to assign the string:
>
> 1=1
>
> to the variable criteria using this construct:
>
> <dtml-let criteria='1=1'>
>
> but I can't because Zope complains:
>
> invalid parameter: "=1'", for tag <dtml-let criteria='1=1'>, on line 5 of
> Create_List
>
> Some playing around reveals that it doesn't like spaces and the equals sign
> (=) in the string.
>
> Am I correct in thinking that something delimited by single quotes (eg.
> 'this is a string') is a string? If so why can't I (or how can I) include
> spaces and the equal sign inside the string.

<dtml-let criteria=="'1=1'"> should work.

In dtml-let, you write one pair of quotes to specify that your're writing a
python expression. Inside quotes you're writing python.

Examples of valid python expressions:
   'this is a string'
   23
   methodname

You can wrap up any of the above inside a pair of double quotes and then use it
in <dtml-let>

HTH,
Shalabh
______________________________
Shalabh Chaturvedi
icq://43284067
http://advogato.org/person/shalabh/