[mod_python] using nested blocks in psp

ziapannocchia at gmail.com ziapannocchia at gmail.com
Mon Jun 12 04:35:41 EDT 2006


In the code at the and of the post, the for instruction flux depends
from the nested if.

Behaviour expected: for any item, the for instruction executes the if
instruction and
write the option tag.

Real behaviour: the for instruction runs well only if the control in
the if instruction fails. If the control is true, the flux jumps to the
next item and the option tag is not printed on html output.

I need to understand if that depends from a bad indentation or if
structures with more than one ":" are not supported in psp.

Sorry for my english.

[code]
<html>
<form>
 <select name="Elenco">
 <!--genera elenco usando un loop -->

<%
for i in range(50, 350, 50):
 if 'Elenco' in form and int(form['Elenco'])==i:
  sel='selected'
 else:
  sel=''
  #
 %>
 <option value="<%=i%>" <%=sel%> >
  <%=i%>
 </option>
 <%
%>
 </select>
 <input type="submit" value="acquisizione"/>
</form>
</html>
[/code]


More information about the Mod_python mailing list