[ZPT] Help with ZPT, python, and zsql

Tom Twyman fr0gger03 at hotmail.com
Tue Mar 1 21:36:43 EST 2005


I am trying to put together a Zope site with Zsql and ZPT.  Currently, I 
have  a zpt that displays results from a zsql method (sqlvw_classes):

<tr tal:repeat="item here/sqlvw_classes" >

<td tal:content="item/classid">
Class ID
</td>
<td tal:content="item/class_title">
Class title
</td>
<td tal:content="item/class_length_hrs">
  Class Hours
</td>
<td tal:content="item/class_price">
  Class Price
</td>
<td tal:content="item/class_desc">
  Class Desc
</td>
<td>
<a href="fmclassedit classid=3" tal:define="classid item/classid">Edit this 
class</a>
</td>
</tr>


The page correctly displays information from a Postgresql table.  I would 
like to add an anchor tag <a> that would allow the user to click a link, and 
be taken to a form that allows them to edit the record they clicked.  I can 
put together a form easily enough, and attach it to a zsql UPDATE method, 
but I am having trouble figuring out:

- how to create the link using the class title
- passing the classid to the zsql method and zpt form I will use to perform 
the update

Any assistance would be appreciated.

- Tom

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



More information about the ZPT mailing list