[Zope] Building tables with dtml

Berthold Stoeger e9526597@student.tuwien.ac.at
Sun, 6 Feb 2000 02:13:50 +0100 (MET)


Hello, zope gurus!

I've run into yet another newbie problems trying to build tables with
DTML:

* I need to know which position in the current batch i'm rendering. for
this i use the expression: _['sequence-index'] - _['sequence-step-start'].
Isn't there something easier? And btw sequence-step-start is not
documented => this cost my some nerves.

* The tables i build should always have the same numbers of lines, filling
the rest of the table with empty lines if necessary. the code i use goes
like this (inside dtml-if "sequence-end"):

<dtml-in "_.range(_['sequence-index'] - _['sequence-step-start'] + 1,
	  tablesize - 1)">
	<dtml-var "standard_empty_line(_.None, _,
		num=_['sequence-item']
	)">
</dtml-in>

Again, couldn't this be done more easily? What about implementing 2 new
modes: one which calls the <dtml-in> body exactly size times, and sets
sequence-item to None when no more lines are available and another one
which lets the last batch fit exactly?

* I use dynamic dtml-methods to build the tables, and sometimes need more
than 1 table per document. So it is very important, that i can use dynamic
variablenames. but using start="_[varname]" did not work. Is there a way
to do this? if not, would a patch that fixes the problem go into release
or would i have to patch every new version of zope?

* How can i use dynamic C-formats with dtml-var? I build the table from
table definitions, containing a format string. Do i have to use
DocumentTemplates?

* I noticed that when throwing an error inside a <dtml-in previous|next>
tag, the dtml-else path gets executed. i find this annoying as it makes
debugging pretty hard.

sorry, if all these are faqs...

cu,
bertl

ps: please answer via private mail, i cant follow the list because the
disk of the mailserver im using is full since 2 days :(