[Zope] Simplest example of INSERT

Daniel M. Drucker dmd@3e.org
Wed, 2 Jun 1999 11:34:25 -0400 (EDT)


I'm a total Zope newcomer, and I'm attempting to create a test thing
where I can enter data into a form and have that data inserted into a
table in a gadfly database. 

I've read the ZDTML guide, the Z SQL methods guide, and the managers
guide, and none of these seem to give any examples of how to do this
simplest task. (I've found the documentation to be absymal -- no
examples, just definitions.)

I have a 'dataentry.html' that looks something like this:
<form method="post" action="sqltestthing">
Color: <input name="col">
Flavor: <input name="fla">
<input type=submit>
</form>

And then a Z SQL Method 'sqltestthing':
INSERT INTO TESTTABLE (color,flavor)
VALUES (<!--sqlvar col type=nb-->,<!--sqlvar fla type=nb-->)


I enter the data into the form page, and hit submit. I get back the
sqltestthing page saying 'This query requires no input.' I hit submit
again, and get 
Error, exceptions.SyntaxError: unexpected token sequence.near ::
'lavor)\012VALUES ('*',) 


I'm obviously doing this entirely wrong. Perhaps someone could point
me to a simple example of a simple database app in action? 

Daniel Drucker