[Zope] convert python to dtml
Jaroslav Lukesh
lsh@wo.cz
Mon, 21 Jul 2003 10:08:41 +0200
> Odes=EDlatel: Exteam <exteam6@yahoo.co.in>
> hi all,
> i'm stuck at this point,
> can some one convert thge following python code in to
> dtml & help me.
> i'm not able to convert it in to dtml.
Why do you want to recode into DTML? I think that is piece of good code a=
nd
much faster than DTML.
You could try following replacing (original line of your code, follows wi=
th
DTML code), but not tested:
> rec =3D context.test_select_sql()
<dtml-call "REQUEST.set(rec , test_select_sql())">
> print "Fields definitions"
Fields definitions
> recordset =3D rec.dictionaries()
<dtml-let "recordset =3D rec.dictionaries()"
> rownum =3D 1
<dtml-call "REQUEST.set(rownum,1)"
> for record in recordset:
<dtml-in recordset>
> print "Row %d" % (rownum), "check", record
Row <dtml-var rownum>, check <drml-var sequence-item><br>
> rownum =3D rownum + 1
<dtml-call "REQUEST.set(rownum,rownum+1)"
</dtml-in>
and so on on the rest of code.
> for key in record.keys():
> print key, "=3D", record[key]
> print "-" * 80
> return printed