[Zope] dtml-let

Charlie Reiman creiman@kefta.com
Thu, 11 Jul 2002 09:35:04 -0700


dtml-let introduces a new scope. Don't use it. Instead consider one of two
options

1) Use dtml-set. You'll have to download and install the product, but it can
do this sort of thing.

2) Use python. I'd probably do it this way unless your table is very tall.
The python would query the underlying data, munge it and compute totals, and
present the easily rendered list of dicts or list of brains to the final
dtml. You'd also be set to switch to ZPT before Chris hits you with a stick.

Charlie

> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> Alejandro Fernandez
> Sent: Thursday, July 11, 2002 6:43 AM
> To: zope@zope.org
> Subject: [Zope] dtml-let
>
>
> Hi,
>
> I'm trying to output a table using dtml-in, that shows a certain number of
> rows in that table, then adds up the rows not shown, and shows an "other
> values" row, and finally shows totals for all the data in the table.
>
> So the output would be something like this:
>
> Language  Requests  Uniques Sessions     Percent     Time to Load
>    it     92384     293       231         56.1%          3.0
>    fr     51563     65487     21          31.3%          1.0
>    de     9834      9648       521         6.0%          3.2
>
> [Other] 1   5416     25163     31          3.3%          0.0
> Total:     164653     101245     354935    100%          1.44
>
>
> The dtml I'd like to use would be something like this:
>
> dtml-let "set all variables to zero"
>    dtml-in the request
>        dtml-if sequence-number <= floor
>            output a row with data
>        dtml-else
>            dtml-let "add up "other values" data using variables set at
> top"
>        dtml-if sequence-end
>            output "other values" row
>            output "totals" row
>        /dtml-let
>    /dtml-in
> /dtml-let
>
> But dtml-let is zeroing the variables each iteration. Is there a better
> way to do what I'm trying to do?
>
> Thanks,
>
> Ale
>
> --
> Alejandro Fernandez
> Electronic Group Interactive
> --+34-65-232-8086--
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>