dev101 at magma
Oct 16, 2006, 5:27 AM
Post #1 of 1
----- Original Message -----
Re: How do I use my archetypes-generated form to insert datainto a mysql table?
From: "Anna Falkowska" <afalkows [at] umich>
To: <zope-db [at] zope>
Sent: Monday, October 16, 2006 8:13 AM
Subject: [Zope-DB] How do I use my archetypes-generated form to insert
datainto a mysql table?
>I made a form using ArchGenXML and want to use it to populate a table
> in a mysql database. So far I have not come across a good tutorial on
> how to do this. Someone suggested I use ZSQL methods. I understand how
> to create them, but how exactly would I call a ZSQL method with the
> information from my form?
You can use a python script or external method (or even a dtml method) to
access the form data and make the call to the zsql method. Here is an
example I have pulled from an external method:
if not rStat.dictionaries():
# no user account, log error, error return
return (RFAIL, 0)
# here if we found some user record data, so build the return dictionary
dictList = rStat.dictionaries()
In the above example, 'userId' is a form field.
Zope-DB mailing list
Zope-DB [at] zope