tags:

views:

60

answers:

1

i have a

rows=db(db.member.membership_id==request.args[0]).select(db.member.membership_id,db.member.first_name,db.member.middle_name,db.member.last_name,db.member.birthdate,db.member.registration_date,db.member.membership_end_date)
rows.colnames=('Membership Id','First Name','Middle Name','Last Name','Birthday Date','Registration Date','Membership ending Date')
table = SQLTABLE(rows, _width="100%")

i want to transpose the table, how can i do this.

Thanks in advance

A: 

Try this:

rows=db(query).select(*fields).as_list()
if rows:
   table=TABLE(*[TR(TH(field),*[TD(row[field]) for row in rows]) for field in row[0].keys()])
else:
   table="nothing to see here"
return dict(table=table)
mdipierro
This solution cause : UnboundLocalError: local variable 'row' referenced before assignment
Neveen