[Zope] in namespaces

Kent Polk kent@goathill.org
5 May 1999 20:47:31 GMT


I have a tabular object with a column() method which returns a
Results object containing information about the table columns.
This lets me programmatically build results tables pretty nicely:

<TABLE BORDER=1><TR>
<!--#in columns-->
 <TH><!--#var colname--></TH>
<!--#/in--></TR>

<!--#in "this()()"-->
 <TR><!--#in columns-->
   <TD><!--#var "_[colname]"--></TD>
 <!--#/in--></TR>
<!--#/in-->
</TABLE>

However, when I want to try to do some summary statistics on the
tablular object where I build the stat-name, it appears the
statistics() method looks at the wrong results object.

<TABLE BORDER=1><TR>
<TH></TH>
<!--#in columns-->
 <TH><!--#var colname--></TH>
<!--#/in--></TR>

<!--#in "this()()"-->
 <!--#if sequence-start-->
  <TR><TD># Items</TD>
  <!--#in columns-->
    <TD><!--#var "_['count-'+colname]"--></TD>
  <!--#/in--></TR>
 <!--#/if-->
<!--#/in-->
</TABLE>

When statistics() iterates over the results objects, it can't find 
the item 'name' using either getitem or mapping because the 'item'
dictionary contains :

  {'__module__': 'Shared.DC.ZRDB.Results', '__doc__': None} 

instead of just the results object which should contain the item
'name'.  Even if I explicitly name the 'count-column' name, it
still isn't finding the correct object, so I don't think that
I'm off-base using "_['count-'+colname]".

Any clues as to what I'm doing wrong here such that the statistics 
method can't seem to point at the correct object?

Why can
  <!--#var "_[colname]"-->
A
obtain the correct value, but
  <!--#var "_['count-'+colname]"-->
can't?

Thanks
Kent