[Zope-dev] I have two question. Would you help me please.

¹Ú À缺 bigarea@korea.com
Thu, 10 Jan 2002 21:32:52 +0900


This is a multi-part message in MIME format.

------=_NextPart_000_64F6_01C19A1E.520266B0
Content-Type: text/plain;
	charset="ks_c_5601-1987"
Content-Transfer-Encoding: 7bit

Hello. First of all Happy New Year!
This is korea. I am a zope student. On studying I have two question.

Q1. How call the ZSQLMethod into script python.

Firrst I write the script python named 'myscript' and the ZSQLMethod
named 'mySqlMethod'

myscript (script
python)************************************************************
 # Example code:
 # Import a standard function, and get the HTML request and response
objects.
 from Products.PythonScripts.standard import html_quote
 request = container.REQUEST
 RESPONSE =  request.RESPONSE

 # Return a string identifying this script.

 val = context.mySqlMethod()
         
 print val
 return printed

mySqlMethod
(ZSQLMethod)************************************************************

 select * from bbs1 (:bbs1 is the table name of the DB)


How call the 'mySqlMethod'(ZSQLMethod) into 'myscript'(script python)
and 
how display the query results of ZSQL Method called into script python ?
I called mysqlMethod into the above myscript( val =
context.mySqlMethod()). 
But I failed.


Q2. How to display the list type data.

myDTMLMethod(DTMLMethod)************************************************
**

<dtml-var standard_html_header>
<dtml-var "myScript()">
<dtml-var standard_html_footer>


myscript (script
python)**************************************************

 # Example code:
 # Import a standard function, and get the HTML request and response
objects.
 from Products.PythonScripts.standard import html_quote
 request = container.REQUEST
 RESPONSE =  request.RESPONSE

 list1=[]

 vala = 100
 valb = 200

 list1.append(vala)
 list1.append(valb)

 return list1

I worte DTMLMethod named 'myDTMLMethod' and script python named
'myscript'
Above myscript return the list type data. 
Then how display the returned list type data into the myDTMLMethod?
The question part is <dtml-var "myScript()">
But I failed.

How could I resolve thses questions?
Help me!!
Thank you very much.


------=_NextPart_000_64F6_01C19A1E.520266B0
Content-Type: text/html;
	charset="ks_c_5601-1987"
Content-Transfer-Encoding: quoted-printable

<BODY><P><BASEFONT face=3D=B1=BC=B8=B2 size=3D2>Hello. First of all =
Happy New Year!<BR>This is korea. I am a zope student. On studying I =
have two question.<BR><BR>Q1. How call the ZSQLMethod into script =
python.<BR><BR>Firrst I write the script python named 'myscript' and the =
ZSQLMethod named 'mySqlMethod'</BASEFONT></P>
<P><BASEFONT face=3D=B1=BC=B8=B2 size=3D2>myscript (script =
python)************************************************************<BR>&n=
bsp;# Example code:<BR>&nbsp;# Import a standard function, and get the =
HTML request and response objects.<BR>&nbsp;from =
Products.PythonScripts.standard import html_quote<BR>&nbsp;request =3D =
container.REQUEST<BR>&nbsp;RESPONSE =3D&nbsp; =
request.RESPONSE</BASEFONT></P>
<P><BASEFONT face=3D=B1=BC=B8=B2 size=3D2>&nbsp;# Return a string =
identifying this script.</BASEFONT></P>
<P><BASEFONT face=3D=B1=BC=B8=B2 size=3D2>&nbsp;val =3D =
context.mySqlMethod()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
 <BR>&nbsp;print val<BR>&nbsp;return printed</BASEFONT></P>
<P><BASEFONT face=3D=B1=BC=B8=B2 size=3D2>mySqlMethod =
(ZSQLMethod)************************************************************<=
/BASEFONT></P>
<P><BASEFONT face=3D=B1=BC=B8=B2 size=3D2>&nbsp;select * from bbs1 =
(:bbs1 is the table name of the DB)</BASEFONT></P>
<P><BASEFONT face=3D=B1=BC=B8=B2 size=3D2><BR>How call the =
'mySqlMethod'(ZSQLMethod) into 'myscript'(script python) and <BR>how =
display the query results of ZSQL Method called into script python =
?<BR>I called mysqlMethod into the above myscript( val =3D =
context.mySqlMethod()). <BR>But I failed.<BR></BASEFONT><BASEFONT =
face=3D=B1=BC=B8=B2 size=3D2></BASEFONT></P>
<P><BASEFONT face=3D=B1=BC=B8=B2 size=3D2>Q2. How to display the list =
type data.</BASEFONT></P>
<P><BASEFONT face=3D=B1=BC=B8=B2 =
size=3D2>myDTMLMethod(DTMLMethod)****************************************=
**********</BASEFONT></P>
<P><BASEFONT face=3D=B1=BC=B8=B2 size=3D2>&lt;dtml-var =
standard_html_header&gt;<BR>&lt;dtml-var =
"myScript()"&gt;<BR>&lt;dtml-var standard_html_footer&gt;</BASEFONT></P>
<P><BASEFONT face=3D=B1=BC=B8=B2 size=3D2><BR>myscript (script =
python)**************************************************</BASEFONT></P>
<P><BASEFONT face=3D=B1=BC=B8=B2 size=3D2>&nbsp;# Example =
code:<BR>&nbsp;# Import a standard function, and get the HTML request =
and response objects.<BR>&nbsp;from Products.PythonScripts.standard =
import html_quote<BR>&nbsp;request =3D =
container.REQUEST<BR>&nbsp;RESPONSE =3D&nbsp; =
request.RESPONSE</BASEFONT></P>
<P><BASEFONT face=3D=B1=BC=B8=B2 =
size=3D2>&nbsp;list1=3D[]</BASEFONT></P>
<P><BASEFONT face=3D=B1=BC=B8=B2 size=3D2>&nbsp;vala =3D =
100<BR>&nbsp;valb =3D 200</BASEFONT></P>
<P><BASEFONT face=3D=B1=BC=B8=B2 =
size=3D2>&nbsp;list1.append(vala)<BR>&nbsp;list1.append(valb)</BASEFONT><=
/P>
<P><BASEFONT face=3D=B1=BC=B8=B2 size=3D2>&nbsp;return =
list1</BASEFONT></P>
<P><BASEFONT face=3D=B1=BC=B8=B2 size=3D2>I worte DTMLMethod named =
'myDTMLMethod' and script python named 'myscript'<BR>Above myscript =
return the list type data. <BR>Then how display the returned list type =
data into the myDTMLMethod?<BR>The question part is &lt;dtml-var =
"myScript()"&gt;<BR>But I failed.<BR><BR>How could I&nbsp;resolve thses =
questions?<BR>Help me!!<BR>Thank you very =
much.</BASEFONT></P><br><br><br><br><br><table =
id=3D"idKoreaDotComCommonTail" width=3D"350" border=3D"0" =
cellpadding=3D"0" cellspacing=3D"0">
    <tr>
        <td width=3D"15"></td>
        <td width=3D"335"><a href=3D"http://www.korea.com" =
target=3D"_blank"><img src=3D"http://mail.korea.com/images/tail01.gif" =
width=3D125 height=3D18 border=3D"0"></a>&nbsp;&nbsp;
        <font style=3D"font-size:12px; =
font-family:=B1=BC=B8=B2"><b>=C4=DA=B8=AE=BE=C6=B4=C2 =B4=E7=BD=C5=C0=BB =
=BB=E7=B6=FB=C7=D5=B4=CF=B4=D9</b></font><br>
        ---------------------------------------<br>
        <font style=3D"font-size:12px; =
font-family:=B1=BC=B8=B2">=BD=C5=B3=AA=B4=C2 =B0=D4=C0=D3, =
=B9=DD=B0=A1=BF=EE =C4=A3=B1=B8, =B1=D7 =B8=F0=B5=E7 =B0=CD=C0=CC =
=C0=CC=B0=F7=BF=A1!</font><br>
        <font style=3D"font-size:12px; =
font-family:=B1=BC=B8=B2">=B4=EB=C7=A5 =B0=D4=C0=D3 =B8=DE=B0=A1 =
=C6=F7=C5=BB &nbsp;&nbsp;<a href=3D"http://game.korea.com" =
style=3D"text-decoration:none" =
target=3D"_blank">http://game.korea.com</a></font>
        </td>
    </tr>
    <tr>
        <td colspan=3D"2" height=3D"10"></td>
    </tr>
</table><br><br>

</BODY>
------=_NextPart_000_64F6_01C19A1E.520266B0--