The code in sqlhtml.py for SQLTABLE has changed along the way from 2.18.5
to 2.21.1, especially in the way it handles columns.
This used to work:
in 2.21.1, I get an error
{{=SQLTABLE(rows, truncate=35, headers = {'QuarterMaster.IssueYr':'Year',
'QuarterMaster.StateNm':'State', 'QuarterMaster.Other':'Other',
'QuarterMaster.Mint':'Mint', 'QuarterMaster.NumAdded':'Count'},
columns=['QuarterMaster.IssueYr', 'QuarterMaster.StateNm',
'QuarterMaster.Other', 'QuarterMaster.Mint', 'QuarterMaster.NumAdded'],
_class="table-striped myeheaders")}}
in 2.21.1, I get an error
Traceback (most recent call last):
File
"C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\gluon\restricted.py",
line 219, in restricted
exec(ccode, environment)
File
"C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\applications\QuarterMaster\views\default/sortedQ.html",
line 77, in <module>
File
"C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\gluon\sqlhtml.py", line
3544, in __init__
"Column %s not found (SQLTABLE)" % colname)
KeyError: 'Column IssueYr not found (SQLTABLE)'
I've tried "QuarterMaster.IssueYr", "db.QuarterMaster.IssueYr", "IssueYr",
and "rows.IssueYr".
Same error.
If I eliminate the columns argument, no error, but my data doesn't show.
I've verified in the controller that the data gets into rows, and looks like
<Row {'PostDate': datetime.date(2021, 12, 20), 'IssueYr': 1965L, 'StateNm':
None, 'Other': None, 'Mint': 'x', 'id': 3647L, 'NumAdded': 1L}>
What do I need to make this work again?
Dave S
/dps
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/web2py/9cc3a2b1-635e-4477-9794-b6f1b6eec84bn%40googlegroups.com.