[Zope] - Form-based input question (gadfly - Zope Zen)

Brad Marsh research4@snowcrest.net
Sun, 20 Dec 1998 14:29:22 -0800


Baby steps...

I ran the Gadfly example, which worked great, and caused several epiphanies. I can deal with templates now...

SO I decided to try some modifications. I now have a "View the Data" document in the gadflySample folder that shows me the contents of the zopedelic's zopista table in a nice format. Woo-hoo.

Then I decided to try a simple input form that would send values to a  modified insert_data Z SQL Method, which in turn would update the database.

I have:
<FORM NAME="insert" ACTION="insert_data"> 
two <SELECT> boxes, named "cola" and "colb"
<INPUT TYPE="submit" VALUE="Insert Data"> 

When I select two numbers and click the "Insert Data" button, it goes and tries the insert_data method, which I've modified thus:

   insert into zopista (col_a,col_b)
            values (<!--#var cola-->,
                    <!--#var colb-->)

The insert_data method first says, "This query requires no input."
Clicking the "Submit query" button yields an error (not unexpectedly ;), to wit: 
"Error, exceptions.KeyError: cola

SQL used: Could not render the query template!"

I'm missing something big in my Zope Zen...

Where might I find instruction on creating a query that will take forms-based input for its variables? Is there a cool method around that shows the contents of all the variables available (like the PHP <? phpinfo() ?> )?

Thanks for the patience,

Brad

Brad Marsh, Computer Specialist
Center for Evaluation and Research, LLC
(530) 527-5537 or 527-5638 fax
http://www.tchp.org/cer/