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

Milos Prudek prudek@nembv.cz
Tue, 31 Jul 2001 09:06:00 +0200


It seems that it is impossible to use <dtml-in> loop for data gleaned from 
CoreSessionTracking.

I use CoreSessionTracking 0.8 quite extensively, and I only now stumbled 
accross this. Here's an example.

-- This does not work. It gives Incorrect Attribute error for "fname".
<dtml-in expr="data.get('writers')">
  <dtml-var write_1_row>
</dtml-in>

WHERE:

*
writers is correctly stored dictionary (?) gleaned from ":records". I can do 
"<dtml-in expr="data.get('writers')"><dtml-var fname></dtml-in>, so the fname 
is being returned correctly.

*
write_1_row is Script (Python) containing just 
"output=string.strip(context.fname+'  '+context.lname)", and some import and 
output statements.

If I request data using ZSQL instead of CoreSessionTracking, everything works 
fine:

-- This works:
<dtml-in list_article_writers(m_id=m_id)
  <dtml-var write_1_row>
</dtml-in>

WHERE:

* 
list_article_writers is ZSQL Method with "m_id:tokens" parameter, and the 
following content: SELECT fname, lname FROM members WHERE ...etc.

*

Is it just me?

-- 
Milos Prudek