[PIPython] problema script

fr.p a libero.it fr.p
Lun 4 Apr 2005 11:37:54 CEST


Salve,
lo script Python ora funziona con il codice:
page = container['normativa']
return page(Tematica=tematica)

Il problema riguarda il page template normativa, perchè inserendo 
<span tal:content="options/Tematica" /> 
in qualsiasi parte del template. Ad esempio:
<html>
  <head>
    <title tal:content="template/title">The title</title>
  </head>
  <body>
 <span tal:replace="structure here/header">
</span>

<tal:div tal:condition="python:request.has_key('Nome')" tal:repeat="row python: here.getattivita(Nome=request['Nome'],Tematica=request.form['Tematica'])">
<h1>  

<span tal:content="string:${row/titolo}">titolo</span>
</h1>


</tal:div>
  <h2> Emissioni in atmosfera</h2>
<div>
    
    <tal:div  tal:condition="python:request.has_key('Tematica')" tal:repeat="row python: here.normtematica(Tematica=request.form['Tematica'])">
    <span tal:content="options/Tematica" />
    <h2><span tal:content="string:${row/legge}">legge</span></h2>    <p>
     <span tal:content="string:${row/descrizione}"/><br>
     <a href="addnorm">Inserisci</a>
   
  </tal:div>
 
    
</div>

  </body>
</html>


Oppure:

<html>
  <head>
    <title tal:content="template/title">The title</title>
  </head>
  <body>
 <span tal:replace="structure here/header">
</span>

<tal:div tal:condition="python:request.has_key('Nome')" tal:repeat="row python: here.getattivita(Nome=request['Nome'],Tematica=request.form['Tematica'])">
<h1>  

<span tal:content="string:${row/titolo}">titolo</span>
</h1>


</tal:div>
  <h2> Emissioni in atmosfera</h2>
<div>
    
    <tal:div  tal:condition="python:request.has_key('Tematica')" tal:repeat="row python: here.normtematica(Tematica=request.form['Tematica'])">
        <span tal:content="options/Tematica" />
    <h2><span tal:content="string:${row/legge}">legge</span></h2>    <p>
     <span tal:content="string:${row/descrizione}"/><br>
     <a href="addnorm">Inserisci</a>
   
  </tal:div>
 
    
</div>

  </body>
</html>


Viene restituito il seguente messaggio d'errore:
Site Error
An error was encountered while publishing this resource. 

Error Type: KeyError
Error Value: 'Tematica'



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

Troubleshooting Suggestions

This resource may be trying to reference a nonexistent object or variable 'Tematica'. 
The URL may be incorrect. 
The parameters passed to this resource may be incorrect. 
A resource that this resource relies on may be encountering an error. 
For more detailed information about the error, please refer to the error log. 

If the error persists please contact the site maintainer. Thank you for your patience. 

Non capisco il motivo dell'errore.
In attesa di un gentile riscontro, porgo distinti saluti.




____________________________________________________________
6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di Libero!
Scaricalo su INTERNET GRATIS 6X http://www.libero.it




More information about the Python mailing list