How about: <dtml-let "a=data.get('writers')"> <dtml-var "display(a)"> </dtml-let> Where display is: display (Python Script) arguments: data return data.get('fname') Milos Prudek wrote:
It's a dictionary? Are you sure? If so, wouldn't you need:
Good question. It isn't. Sorry. It's a set of data received from form using ":records". I don't know what it's called in Python. It looks as follows: [fname: "Chris", lname: "McDonough", fname: "John", lname: "Malkovich"]
You can iterate over it successfully: <dtml-in "data.get('writers')"><dtml-var fname></dtml-in>.
Hypothesis: the above <dtml-in> puts "fname" into DTML namespace. Therefore it should be accessible from Python Script using "context.":
<dtml-in "data.get('writers')"><dtml-var display></dtml-in>
display (Python Script): a="<b>"+context.fname+"</b>" return a
But it fails with Attribute Error. I do not comprehend why it fails.
This looks like Level II Zope Zen, and it's more difficult than I thought.
-- 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 """