Is it possible to nest <dtml-in> constructs such that the inner structure still has access to the data in the outer structure? My reading of the DTML guide seems to indicate that the answer is no. It appears that the name of the item for iteration is "sequence-item" at all levels. Is there a better way to handle two dimensional data using <dtml-in>? The guide seems to imply that it is possible for the <dtml-in> construct to set up a name for each value in a column. But nothing is said about how this can be arranged. I am calling an external method to get the data. I thought I might be able to return a table from this method and then access the value using <dtml-var> by suppling key names. That doesn't work. I suppose I could try using an expr clause in <dtml-var>. But I get the feeling that there is a more obvious way that I haven't discovered in the documentation. David S. Harrison (dsh@magma-da.com)
On Fri, 5 Nov 1999, David S. Harrison wrote:
Is it possible to nest <dtml-in> constructs such that the inner structure still has access to the data in the outer structure? My reading of the DTML guide seems to indicate that the answer is no. It appears that the name of the item for iteration is "sequence-item" at all levels.
The dtml-let tag is your friend <dtml-in myouterlist> <dtml-let outeritem=sequence-item> <dtml-in myinnerlist> <dtml-let inneritem=sequence-item> Inner: <dtml-var inneritem><br> Outer: <dtml-var outeritem><br> </dtml-let> </dtml-in> </dtml-let> </dtml-in> ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen
Hello all, I use Zope 2.01 on Red Hat 6.0 with Apache+Zope and multi-hosting. After I reboot the server, I have this message when Zope start : "VFS : file-max limit 4096 reached" Is it a warning or an error ? What is the problem ? Thanks.
On Tue, 9 Nov 1999, [iso-8859-1] AndrИ LAGADEC wrote:
I use Zope 2.01 on Red Hat 6.0 with Apache+Zope and multi-hosting.
After I reboot the server, I have this message when Zope start : "VFS : file-max limit 4096 reached"
Is it a warning or an error ? What is the problem ?
It is warning from linux kernel - max number of opend files reached. To increase the number do as root echo 8192 > /proc/sys/kernel/file-max ^^^^^ or greater and don't forget to insert the command into /etc/rc... Oleg. ---- Oleg Broytmann Foundation for Effective Policies phd@phd.russ.ru Programmers don't die, they just GOSUB without RETURN.
"David S. Harrison" wrote:
Is it possible to nest <dtml-in> constructs such that the inner structure still has access to the data in the outer structure? My reading of the DTML guide seems to indicate that the answer is no. It appears that the name of the item for iteration is "sequence-item" at all levels.
I had this exact same problem this morning. I finally solved it by assigning the variables from the outer loop to new variables before entering the inner loop. For example: <dtml-in some_sql_query> <dtml-let var1=some_sql_field1 var2=some_sql_field2> <dtml-in some_other_sql_query> <dtml-if "some_other_sql_field==var1"> Do Something </dtml-if> </dtml-in> </dtml-let> </dtml-in I actually wound up executing the inner query a single time and assigning it to a variable <dtml-let queryResult=some_other_sql_query> before entering the outer query. This prevents the parser from having to go to the cache for the query results (or worse, the database) during every iteration of the outer loop. --sam
David S. Harrison wrote:
Is it possible to nest <dtml-in> constructs such that the inner structure still has access to the data in the outer structure? My reading of the DTML guide seems to indicate that the answer is no. It appears that the name of the item for iteration is "sequence-item" at all levels.
The answer is yes, each nested level of tags adds a new namespace to the DTML Nspace stack, a name is looked up in each Nspace on the stack until and attribute is found. Therefore, the innermost 'sequence-item' is returned instead of the outermost. Stuart and Sam posted two great examples of how to move the name your looking for to another name with the <dtml-let> tag. -Michel
On Fri, 05 Nov 1999, David S. Harrison wrote:
Is it possible to nest <dtml-in> constructs such that the inner structure still has access to the data in the outer structure? My reading of the DTML guide seems to indicate that the answer is no. It appears that the name of the item for iteration is "sequence-item" at all levels.
I think, please someone correct me if I am wrong, that you can do nested dtml-ins. If you items a have a vasriable name associated with it, you can use the variable name to refer to things instead of *-item. I think I used that before. But because of how the namespaces are looked up that should definately work. Remember, if you have a query and you query for the column called "name" theb you can refer in the dtml-in statement to the returned values as "sequence-items" or "name" I think that should help you out. regards, stephan. -- Stephan Richter iXL - Software Designer and Engineer CBU - Physics, Computer Science and Chemistry Student
participants (7)
-
André LAGADEC -
David S. Harrison -
Michel Pelletier -
Oleg Broytmann -
Sam Gendler -
Stephan Richter -
Stuart 'Zen' Bishop