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? Thanks
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?
Kent Polk wrote:
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]"-->
maybe you mean "_['count-' + _['colname']]"
7: <!--#/in--> 8: <!--#/in--> 9: <!--#/in-->
Hannu
On 14 May 1999 05:15:00 -0500, Hannu Krosing wrote:
Kent Polk wrote:
4: <!--#in columns--> 5: <!--#var "_[colname]"--> 6: <!--#var "_['count-'+colname]"-->
maybe you mean "_['count-' + _['colname']]"
"_['count-'+colname]" "_['count-'+_['colname']]" and "_.getitem('count-'+colname)" all return the same thing - a string. It's the correct name and key, but 'self.items' is the wrong self.items: DT_InSV.py: def statistics(self,name,key): items=self.items I'm pretty baffled as to how to build a key and not have DTML treat it as a string, which, I'm pretty sure, is the problem. Kent
participants (2)
-
Hannu Krosing -
kent@tiamat.goathill.org