[Tutor] html and mod_python
Patty
patriciap.gu at gmail.com
Thu Mar 23 16:54:03 CET 2006
Hi again!
result[0] is the value i got from the database. I tried the following piece of
code and got :
"TypeError: not enough arguments for format string"
if result [0] in range(0, 101, 10):
selected_value = result[0]
else:
selected_value = '-'
tag = """
<select name='percent'>
<option selected VALUE=%s>%s</option>
<option VALUE='-'>-</option>
<option VALUE='0'>0%</option>
<option VALUE='10'>10%</option>
<option VALUE='20'>20%</option>
<option VALUE='30'>30%</option>
<option VALUE='40'>40%</option>
<option VALUE='50'>50%</option>
<option VALUE='60'>60%</option>
<option VALUE='70'>70%</option>
<option VALUE='80'>80%</option>
<option VALUE='90'>90%</option>
<option VALUE='100'>100%</option>
</select>""" % (selected_value,selected_value)
return tag
What am I doing wrong?
Thanks,
Patty
More information about the Tutor
mailing list