All pastes #136412 Raw Edit

Miscellany

public text v1 · immutable
#136412 ·published 2006-08-17 17:29 UTC
rendered paste body
ZPT que manda o parametro
<!---Form que manda o parametro--->
<form method=get action=".">
   <table border="1" width="50%">
     <tr>
       <th>Consultar</th>
         <td><input type="text" name="consulta_cliente" value="" maxlenght="40" size="40" style="text-transform:uppercase;"> <input type="submit" value="Consultar" name="consulta_cliente_py:method"></td>
     </tr> 
   </table><br/>
</form>

<!---Resultados irão ser exibidos nessa tabela-->
<table border="1">
  <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><p tal:content="resultados/nomefantasia"/></td>       
     </tr>
  </metal:block>
</table>


PyScript que recebe no Parameter List 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

if consulta_cliente is not None:
  nome_para_consulta = request.consulta_cliente
  fp_sql = context.zsql_select_cliente(nomefantasia=nome_para_consulta.upper())
  return context.consulta_cliente(consulta_cliente=fp_sql)

Traceback:
Tipo de Erro
    SystemError
Valor do Erro
    Excessive recursion