My solution for formatting output

23 views
Skip to first unread message

jason

unread,
Feb 21, 2011, 12:30:08 AM2/21/11
to PyDbLite
Using the feedback I received from Jim and Pierre, here is how I
solved my problem:


recs = [ r for r in db if q == r['Country']]
# where q = Query string submitted from dropdown menu



table = TABLE()


for record in recs:
for (key,value) in record.items():
table <= TR(TD(key)+TD(value))
print table

Pierre Quentel

unread,
Feb 21, 2011, 4:37:11 AM2/21/11
to PyDbLite
Ola !

That's correct. You can select the records with a simpler syntax :

recs = db(Contry=q)

- Pierre
Reply all
Reply to author
Forward
0 new messages