[Zope] passing the parameters to zsql method

Maurits van Rees maurits at vanrees.org
Thu Oct 27 09:18:35 EDT 2005


On Thu, Oct 27, 2005 at 10:23:52AM +0200, Dario Lopez-Kästen wrote:
> Not sure if this works, but that is the general idea. This was inspired from
> 
> http://www.plope.com/Books/2_7Edition/AdvZPT.stx#2-9
> 
> section: "Form Processing"

I would suggest to give it a try with a Z Search Interface.  See the
same book, in the chapter on Relational Databases:
http://www.plope.com/Books/2_7Edition/RelationalDatabases.stx#1-11

This assists you in making two pages, at your choice as either DTML
Methods or Page Templates.  Like most people here I would suggest
going for the Page Templates.  One is a form in which you can enter
the values for your Z SQL Method.  This then passes control to the
second page, which is a report that gets its input by calling the Z
SQL Method.

The form basically is:

<form action="<id of your report page" method="get">
...
<input type="SUBMIT" name="SUBMIT" value="Submit Query">

The report basically starts with:

<html>
  <body tal:define="results  here/<id of your Z SQL Method>">


Note that when your Z SQL Method only has an update or insert or
delete it will usually not return a lot of results, so the report will
be basically empty.  I would say it is nice if the user gets some
feedback, so put some related select statement after your normal
query, even if it is just: SELECT * from your_table.  This gives the
report something to present to the user as visual feedback, instead of
leaving him in the dark on whether the submission of the form actually
had any permanent results.

-- 
Maurits van Rees | http://maurits.vanrees.org/ [Dutch/Nederlands] 
Public GnuPG key:  http://maurits.vanrees.org/var/gpgkey.asc
"It can seem like you're doing just fine,
but the creep's creeping into your mind." - Neal Morse
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope/attachments/20051027/72148de6/attachment.bin


More information about the Zope mailing list