
charlie at egenix
Oct 16, 2006, 6:23 AM
Post #2 of 2
(1137 views)
Permalink
|
|
Re: How do I use my archetypes-generated form to insert data into a mysql table?
[In reply to]
|
|
Am 16.10.2006, 14:13 Uhr, schrieb Anna Falkowska <afalkows [at] umich>: > 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? Hi, check the section on ZSQL in the Zope Book to understand how ZSQL works but I suggest you proceed as follows. Pass your form into a PythonScript to run checks pretty much like this: request = context.REQUEST for item in request.form.keys(): validate(item) if no_errors: context.SQL.someZSQLMethod(dictionary_of_items) return context.thank_you_page() else: return context.error_page() Charlie -- Charlie Clark eGenix.com Professional Python Services directly from the Source >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ Try mxODBC.Zope.DA for Windows, Mac OS, Linux, Solaris, FreeBSD for free! _______________________________________________ Zope-DB mailing list Zope-DB [at] zope http://mail.zope.org/mailman/listinfo/zope-db
|