Whenever I pass a complicated data structure to Mako, it's hard to iterate it. For example, I pass a dict of dict of list, and to access it in Mako, I have to do something like:
% for item in dict1['dict2']['list']: ... %endfor
I am wondering if Mako has some mechanism that could replace []
usage to access dictionary elements with simple .
?
Then I could write the line above as:
% for item in dict1.dict2.list: ... %endfor
Which is much nicer, isn't it?
Thanks, Boda Cydo.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…