I think I am passing the wrong argument to the Print_row routine:
Traceback (most recent call last):
File "index.py", line 91, in ?
zhtml.print_row (record)
File "/usr/www/users/homebase/realprogress/zingers/zhtml.py", line
154, in pri
nt_row
print """<tr>
TypeError: format requires a mapping
homebase@upsilo n%
routine from zhtml.py:
#row is a dictionary with keys: zid, keywords, citation, quotation
def print_row(row):
print """<tr>
<td class="pad">%(k eywords)s
</td>
<td class="pad">%(q uotation)s
</td>
<td class="pad">%(c itation)s
</td>
<td class="pad" align="center"> <form action="update. py"
name="updatefor m" enctype="applic ation/x-www-form-urlencoded"
method="GET"><i nput type="hidden" name="zid" value="%(zid)d" ><input
type="submit" value="Edit"></form>
</td>
</tr>
"""
code from index.py:
cursor.execute( querystring);
# get the resultset as a tuple
result = cursor.fetchall ()
# iterate through resultset
for record in result:
print record[0] , "-->", record[1]
#zq = zc.query(querys tring).dictresu lt()
#HTML
import zhtml
zhtml.print_sta rt_html()
zhtml.print_hea der("Frankie's Zingers")
if form.has_key("p rintview"):
print ("xxxxthenxxxxx x")
zhtml.printp_st art_table()
zhtml.printp_ti tle_row()
for record in result:
zhtml.printp_ro w(record[row])
else:
# print ("xxxxxelsexxxx x",record[1]);
zhtml.print_top _controls(k=k,c =c,q=q)
zhtml.print_sta rt_table()
zhtml.print_tit le_row()
zhtml.print_sea rch_row(k=k,c=c ,q=q)
for record in result:
print(record);
zhtml.print_row (record)
zhtml.print_end _table()
zhtml.print_end _html()
how do i go about mapping that, if tha'ts what I need to do.
thanks again for your help.
bests,
-rsr-
Traceback (most recent call last):
File "index.py", line 91, in ?
zhtml.print_row (record)
File "/usr/www/users/homebase/realprogress/zingers/zhtml.py", line
154, in pri
nt_row
print """<tr>
TypeError: format requires a mapping
homebase@upsilo n%
routine from zhtml.py:
#row is a dictionary with keys: zid, keywords, citation, quotation
def print_row(row):
print """<tr>
<td class="pad">%(k eywords)s
</td>
<td class="pad">%(q uotation)s
</td>
<td class="pad">%(c itation)s
</td>
<td class="pad" align="center"> <form action="update. py"
name="updatefor m" enctype="applic ation/x-www-form-urlencoded"
method="GET"><i nput type="hidden" name="zid" value="%(zid)d" ><input
type="submit" value="Edit"></form>
</td>
</tr>
"""
code from index.py:
cursor.execute( querystring);
# get the resultset as a tuple
result = cursor.fetchall ()
# iterate through resultset
for record in result:
print record[0] , "-->", record[1]
#zq = zc.query(querys tring).dictresu lt()
#HTML
import zhtml
zhtml.print_sta rt_html()
zhtml.print_hea der("Frankie's Zingers")
if form.has_key("p rintview"):
print ("xxxxthenxxxxx x")
zhtml.printp_st art_table()
zhtml.printp_ti tle_row()
for record in result:
zhtml.printp_ro w(record[row])
else:
# print ("xxxxxelsexxxx x",record[1]);
zhtml.print_top _controls(k=k,c =c,q=q)
zhtml.print_sta rt_table()
zhtml.print_tit le_row()
zhtml.print_sea rch_row(k=k,c=c ,q=q)
for record in result:
print(record);
zhtml.print_row (record)
zhtml.print_end _table()
zhtml.print_end _html()
how do i go about mapping that, if tha'ts what I need to do.
thanks again for your help.
bests,
-rsr-
Comment