I am building a dictionary in an external method: dict = {'user_name':'jim', 'password':'powers'} I also add it to the request: container.REQUEST.set('results', dict) The problem is that I am unable to retrieve the results dictionary on my dtml document. When I do: <dtml-var "REQUEST.get('results')"> I can see my dictionary but I am not able to get the individual values in the dictionary. Nothing worked so far. I guess it's a case of cascading dictionaries in dtml document. Help, please
Reda Guermas wrote:
I am building a dictionary in an external method:
dict = {'user_name':'jim', 'password':'powers'}
I also add it to the request: container.REQUEST.set('results', dict)
The problem is that I am unable to retrieve the results dictionary on my dtml document. When I do: <dtml-var "REQUEST.get('results')"> I can see my dictionary but I am not able to get the individual values in the dictionary.
You're simply not doing it right: <dtml-var "REQUEST.get('results')['user_name']"> Don't post question like this to zope-dev, use the regular zope list. And you should read the Python tutorial: http://www.python.org/doc/current/tut/tut.html -Michel
participants (2)
-
Michel Pelletier -
Reda Guermas