All pastes #136198 Raw Edit

Stuff

public text v1 · immutable
#136198 ·published 2006-08-17 14:30 UTC
rendered paste body
Meu ZPT
<div>
<form method=get action=".">
   <table border="1" widht="75%">
     <tr>
       <th>Consultar</th>
         <td><input type="text" name="consulta_cliente" value="" maxlenght="40" size="40"> <input type="submit" value="Consultar" name="consulta_cliente_py:method"></td>
     </tr> 
   </table><br/>
</form>

<table>
  <metal:block tal:define="items python:here.consulta_cliente_py(request.get('consulta_cliente'))" 
               tal:condition="exists:items" 
               tal:repeat="resultados items">

     <tr tal:define="pintar repeat/resultados/even"
         tal:attributes="bgcolor python:test(pintar, '#FFFFE0', '#FFFFFF')">
         <td><a tal:attributes="href resultados/nomefantasia" tal:content="resultados | nothing">Resultado</a></td>       
     </tr>
  </metal:block>
</table>
</div>

Meu PY recebe parametro consulta_cliente
# Import a standard function, and get the HTML request and response objects.
from Products.PythonScripts.standard import html_quote
request = container.REQUEST
RESPONSE =  request.RESPONSE

nome_para_consulta = consulta_cliente.upper()
consulta = context.zsql_select_cliente(nomefantasia=nome_para_consulta)
return consulta