Answer below

Infor Gates wrote:
Hello Zopist

I am new and try to learn python script with ZSQL in
Zope. I have read the Zope Book. However, most of them
are in DTML and very few on python script. I have a
little knowledge on Zope and SQL but am lost in trying
to see the whole picture of zope/pythonscript/zsql.

I have a simple database record of person details.

I used a simple insertZSQL statement:
p_givenname, p_familyname, p_datebirth, p_sex )
<dtml-sqlvar p_givenname type="string">
<dtml-sqlvar p_familyname type="string">
<dtml-sqlvar p_datebirth type="string">
<dtml-sqlvar p_sex type="string">

In DTML script:
<dtml-call "REQUEST.set('p_givenname','Ian')">
<dtml-call "REQUEST.set('p_familyname','Gates')">
<dtml-call "REQUEST.set('p_datebirth','22-10-56')">
<dtml-call "REQUEST.set('p_sex','Male')">
<dtml-call insertZSQL>

How can I do something similar in python script?

context.REQUEST.set('p_givenname','Ian') ...

But note that if the input data is originating in a form then it is already in the REQUEST and you do not need to use set.


Can anyone point me to an example? Very much

Thank you.

Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around _______________________________________________
Zope-DB mailing list
Zope-DB mailing list

Reply via email to