[Zope] Zope question (while using Plone)

Christopher A. Nethery can at wasmerschroeder.com
Tue Nov 21 15:27:56 EST 2006


Hello,

 

I am trying to create a page template in the ZMI that functions in the
following way:

 

1)       Page contains two entry fields

2)       The values from the entry fields become arguments for a ZSQL
method

3)       The results of executing the ZSQL method are output to the same
page, below the initial entry form

 

When I test my page template, I receive a NameError, indicating that
name 'start_date' is not defined.

 

I would assume that I need to use dtml tags or define two tal variables,
but I am unsure about how to implement them.

 

Here is what I have, so far:

 

ZSQL Method (DBTestQueryMethod):

------------

 

select

FIRST_NAME, LAST_NAME from EMPLOYEES

WHERE

HIRE_DATE BETWEEN

<dtml-sqlvar "start_date" type=string>

AND

<dtml-sqlvar "end_date" type=string>

 

(I know, I won't get the entire range with this query)

 

ZSQL Method Arguments:

----------------------

start_date, end_date

 

Page Template:

--------------

 

<html>

 

<head>

<title tal:content="template/title">The title</title>

</head>

 

<body>

 

<h1 id="title" tal:content="template/title">This is where the main
heading goes</h1>

 

<form action="output.html" method="get"> Please Enter Start Date: <input
type="string" name="start_date" width="30" value=""> Please Enter End
Date: <input type="string" name="end_date" width="30" value=""> <input
type="SUBMIT" name="SUBMIT" value="OK">

 

</form>

 

  <table border=0>

    <tr>

    <th>First Name</th>

    <th>Last Name</th>

    </tr>

 

    <div tal:repeat="result here/DBTestQueryMethod">

 

    <tr>

    <td><span tal:replace="result/FIRST_NAME ">FIRST_NAME goes
here</span></td>

    <td><span tal:replace="result/LAST_NAME"> LAST_NAME goes
here</span></td>

    </tr>

    </div>

  </table>

 

</body>

</html>

 

 

Page Property

-------------

dynamicContent boolean

 

 

I would be very grateful for any direction you could provide me with.

 

 

Thanking you in advance,

 

Chris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20061121/f1b1e7c9/attachment.htm


More information about the Zope mailing list