[Zope] CoreSessionTracking's get looped in <dtml-in> does not work?

Chris McDonough chrism@zope.com
Mon, 06 Aug 2001 09:32:01 -0400


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 """