It seems strange that the db.field 'label' is not used as the column
header by default in SQLTABLE.  After all,  if someone has gone to the
trouble of specifying a 'label',  surely they would wish to use it
everywhere.  I eventually found this excellent tip from Massimo.

Controller:
headers=dict([(c,db[c.split('.')[0]][c.split('.')[1]].label) for c in
rows.colnames])

View:
{{=SQLTABLE(rows, headers=headers)}}

Please could we add this functionality to the core?  Or, at least
include it in the book, (sorry if I missed it).

Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to