[Zope-DB] Using Page templates and viewing results from a zsql method

Dario Lopez-Kästen dario at ita.chalmers.se
Thu Aug 19 12:51:04 EDT 2004

Laura McCord wrote:

> Hi,
>  I have a page template that contains various links, such as
> Applications, CPU, Operating System, etc...
> These links all trigger an sql method. For example, if I select the link
> Applications, a web page will open displaying a listing of installed
> applications on a computer. 
> My question is, how can I get the results of the sql method to appear
> below the links (on the same page)?

for instance, you use a tal:repeat statement with the results of either 
the ZSQLmethod itself, or with the results of a Script(Python) that 
returns a list or a dictionary.


<tal:listing define="myList python: here.getMyList()">

   <tal:span condition="myList" repeat="myItem myList">
     <td tal:content="myItem"> an Item </td>

   <tal:span condition="not: myList" >
     <td>No items in list!</td>


You really need to read up ZPT in the Zope book - this is all fairly 
well described there.

Hope this helps,


-- -------------------------------------------------------------------
Dario Lopez-Kästen, IT Systems & Services Chalmers University of Tech.

More information about the Zope-DB mailing list