[Zope] Re: namespaces

Kent Polk kent@goathill.org
13 May 1999 21:59:54 GMT


On 13 May 1999 21:31:03 GMT, Kent Polk wrote:
>
>In the following example, "columns" is a method that returns the 
>list of columns wrapped in a Results object. "col2" is the name of
>one of the columns. Line 3 and line 5 provide the correct answer.
>Line 6, however is looking at the columns namespace to render the
>results and there's no data there.  
>
>1: <!--#in table-->
>2:  <!--#if sequence-end-->
>3:   <!--#var "_['count-col2']"-->
>4:   <!--#in columns-->
>5:     <!--#var "_[colname]"-->
>6:     <!--#var "_['count-'+colname]"-->
>7:   <!--#/in-->
>8:  <!--#/in-->
>9: <!--#/in-->
>
>1) Why are "_[colname]" and "_['count-'+colname]" given different
>namespaces?
>
>2) how do I get "_['count-'+colname]" to have the table namespace
>instead of the columns namespace?

I should also mention that, yes, I know that if you replace
line 5 with:
   <!--#var "_['colname']"-->
it simply returns the the string name of 'colname', as
mentioned in the manual, so obviously

 "_['count-'+colname]" is returning a string also. 

 And
 "_.getitem('count-'+colname)", also returns a string,

So how do I turn the string back into an object of the same name?