Re: [Zope] Using DTML - I'm too stupid
<!--#var "w['A']"-->
This works for me.
This works for me too :-))) Thanks But I have another little problem. I have a array of dictonaries {'Pos': [{'a': '123', 'b': '456', 'c': '789'}, {'a': '321', 'b': '654', 'c': '987'}]} and I want to iterate over this array: <!--#in Pos--> <!--#var ???--> <!--#/in--> What variable name must I use. "a" (b,c) and sequence-item['a'] doesn't work. I only read the DTML User's Guide, are there other docs, which describe DTML? Oliver
On Sat, 10 Apr 1999, Oliver Thuns wrote:
But I have another little problem. I have a array of dictonaries
{'Pos': [{'a': '123', 'b': '456', 'c': '789'}, {'a': '321', 'b': '654', 'c': '987'}]}
and I want to iterate over this array:
<!--#in Pos--> <!--#var ???--> <!--#/in-->
Usually I do it as follows: Pos = [{'a': '123', 'b': '456', 'c': '789'}, {'a': '321', 'b': '654', 'c': '987'}] <!--#in Pos--> <!--#var a--> <!--#var b--> <!--#var c--> <!--#/in--> Look into examples 4 and 6 that I've sent to you.
What variable name must I use. "a" (b,c) and sequence-item['a'] doesn't work.
If you want to use sequence-item, this is the way: <!--var "_['sequence-item']['a']"-->
I only read the DTML User's Guide, are there other docs, which describe DTML?
I havn't read anything special - just DTML Guide (and even it I havn't read too careful :) and this mailing list. And just a little brain, but I hope most of us have it :)))
Oliver
Oleg. ---- Oleg Broytmann National Research Surgery Centre http://sun.med.ru/~phd/ Programmers don't die, they just GOSUB without RETURN.
On Sat, 10 Apr 1999, Oliver Thuns wrote:
<!--#var "w['A']"-->
This works for me.
This works for me too :-))) Thanks But I have another little problem. I have a array of dictonaries
{'Pos': [{'a': '123', 'b': '456', 'c': '789'}, {'a': '321', 'b': '654', 'c': '987'}]}
and I want to iterate over this array:
<!--#in Pos--> <!--#var ???--> <!--#/in-->
the <!--# in ... construct can take an extra argument 'mapping' that tells the iterator how to look for subelements. For instance: <!--# in mydict mapping--> you can also use the <!--# with Pos--> construct. I believe they are all explained in the DTML manual. Pavlos
participants (3)
-
Oleg Broytmann -
Oliver Thuns -
Pavlos Christoforou