[Zope] Evaluating Output of Scripts as HTML in DTML Pages
Samir Mishra
SamirMishra@cbuae.gov.ae
Tue, 25 Mar 2003 12:33:55 +0400
BTW perhaps there's a better way to achieve this that I haven't considered,
so please let me know.
As for the (as yet non-existent) script I mention below -
myParseDTML("3.4","Cheques in System", "RA3_4","NRA3_4", "TOT3_4")
I was thinking I'd store a list (of lists) in the directory, where one of
the elements of the list would be the above.
Can I use an external method to generate the html? How?
Thanks.
-----Original Message-----
From: Samir Mishra [mailto:SamirMishra@cbuae.gov.ae]
Sent: Tuesday, March 25, 2003 12:17
To: 'zope@zope.org'
Subject: [Zope] Evaluating Output of Scripts as HTML in DTML Pages
Hello all,
I'm not even sure where I can look for the answer to this problem.
I have a SQL table with a large number of variables. I have a data entry
form that uses the following logic about 30 times on a page -
----------------------------
<dtml-let a=RA3_4 b=NRA3_4 t=TOT3_4>
<tr>
<td />
<td>3.4</td>
<td class="row-label">
<dtml-if "a+b==t"><span>
<dtml-else><span class="error">
</dtml-if>
Cheques in System</span></td>
<td><input type="text" dir="rtl" name="RA3_4" value="<dtml-var a>"
size="12" maxlength="12" /></td>
<td><input type="text" dir="rtl" name="NRA3_4" value="<dtml-var b>"
size="12" maxlength="12" /></td>
<td><input type="text" dir="rtl" name="TOT3_4" value="<dtml-var t>"
size="12" maxlength="12" /></td>
</tr>
</dtml-let>
---------------------------
What I'd like to be able to do is create a Python script that returns the
above, AND I need the DTML document to recognise it as part of the code. The
above code snippet would be generated by a script, called as -
myParseDTML("3.4","Cheques in System", "RA3_4","NRA3_4", "TOT3_4")
This script would return the above code. My problem is, I can generate the
above code, but it's not evaluated within a DTML Method.
As a simple example, I have the following python script -
-------------
""" script name - testScript """
text="""
<dtml-var standard_html_header>
<dtml-var standard_html_footer>
"""
return text
-------------
How do I get the return value of this script to actually display the above
items in a DTML Method?
(I hope I've explained this well)
Thanks in advance. Any help will be greatly appreciated.
Samir.
_______________________________________________
Zope maillist - Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )