[Zope] How-do-I use a form and do an insert/update?

Philip Aylesworth purple@mnsi.net
Mon, 22 Feb 1999 09:22:45 -0500


>Hi,
>
>  I'm still on 1.9, and missing a concept...
>
>  I have defined an addPersonForm that works just like I want, which I
>  execute by http://localhost:9673/SVC/addPersonForm.
>
>  I have a ZSQL method named addPerson that has arguments: name, addr,
>  city, state, zip and phone, which works fine by itself (it prompts for
>  the info)...
>
>  In addPersonForm, the POST method is addPerson... but (now you're
>  chuckling I'm sure ;-) as you know, the doggone addPerson isn't using the
>  stuff that addPersonForm collected...

I feel your pain! ;)

Don't call addPerson from your form. call a DTML method that uses <!--# in
addPerson-->. You can then display info or do a redirect somewhere else.

A good approch to get started is to use the Add "Z Search Interface" to
create all the parts for a SELECT then edit the methods to do INSERT and
UPDATE. (Usually you will want a SELECT at some point anyway!)

Good Luck.

Phil.


-----------------------------------------------------------
Philip Aylesworth                   mailto:purple@mnsi.net