I would like to assign a list to a variable in CoreSessionTracking. This fails: <dtml-call "data.set('varname',"["1"]")> But in python, I can do an assignment a=["1"] I tried to play around with single and double quotes, but to no avail. What am I failing to understand? -- Milos Prudek
<dtml-call "data.set('varname', [])> This does not work? Milos Prudek wrote:
I would like to assign a list to a variable in CoreSessionTracking.
This fails: <dtml-call "data.set('varname',"["1"]")>
But in python, I can do an assignment a=["1"]
I tried to play around with single and double quotes, but to no avail.
What am I failing to understand?
-- Milos Prudek
_______________________________________________ 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 )
-- Chris McDonough Zope Corporation http://www.zope.org http://www.zope.com "Killing hundreds of birds with thousands of stones"
Milos Prudek wrote:
I would like to assign a list to a variable in CoreSessionTracking.
This fails: <dtml-call "data.set('varname',"["1"]")>
But in python, I can do an assignment a=["1"]
I tried to play around with single and double quotes, but to no avail.
What am I failing to understand?
Milos, <dtml-call "data.set('varname',['1'])"> should work. I am guessing you got stumped by the syntax error in your first try. You needed a double quote to complete the data.set() expression : "data.set(blah)". But you did not need the double quotes around the second parameter, because you were already inside a python expression. And since the expression is already inside double quotes, you need to delimit strings with single quotes. If you need more, use a python script. hth, -- Jim Washington
participants (3)
-
Chris McDonough -
Jim Washington -
Milos Prudek