I am trying to use a call like this: <dtml-in assignments> <dtml-call "foo(var=sequence-item)"> </dtml-in> But it gives me Name Error: sequence. Two questions: (1) Why are there -'s in variable names? (2) How do I get around that? -- Ken Kinder 303.381.7631
Ken Kinder wrote:
I am trying to use a call like this:
<dtml-in assignments> <dtml-call "foo(var=sequence-item)"> </dtml-in>
But it gives me Name Error: sequence.
Two questions: (1) Why are there -'s in variable names?
Legacy. python expressions were added after sequence-item.
(2) How do I get around that?
Use the namespace object as a mapping: <dtml-call "foo(var=_['sequence-item'])"> -Michel
On Wed, 22 Mar 2000, Ken Kinder wrote:
I am trying to use a call like this:
<dtml-in assignments> <dtml-call "foo(var=sequence-item)"> </dtml-in>
But it gives me Name Error: sequence.
Two questions: (1) Why are there -'s in variable names? (2) How do I get around that?
I asked much the same question whilst replying to a very similar question recently. the -'s in the names is from times predating Python expressions (afaik). to access that var, use the _ namespace: <dtml-call "foo(var=_['sequence-item'])"> -- Have a better one, Curtis. <dtml-var standard_work_disclaimer>
Ken Kinder wrote:
I am trying to use a call like this:
<dtml-in assignments> <dtml-call "foo(var=sequence-item)"> </dtml-in>
But it gives me Name Error: sequence.
Two questions: (1) Why are there -'s in variable names?
I don't know.
(2) How do I get around that?
<dtml-call "foo(var=_['sequence-item'])"> -- Nick Garcia | ngarcia@codeit.com CodeIt Computing | http://codeit.com
<dtml-in assignments> <dtml-call "foo(var=sequence-item)"> </dtml-in>
I usually end up doing (and that is just me, to stay same): <dtml-in blah> <dtml-let bar=sequence-item> <dtml-call "foo(var=bar)"> </dtml-let> </dtml-in> Regards, Stephan -- Stephan Richter - (901) 573-3308 - srichter@cbu.edu CBU - Physics & Chemistry; Framework Web - Web Design & Development PGP Key: 735E C61E 5C64 F430 4F9C 798E DCA2 07E3 E42B 5391
participants (5)
-
Curtis Maloney -
Ken Kinder -
Michel Pelletier -
Nick Garcia -
Stephan Richter