Problem with Grid Exporter since upgrade from 2.14.6 to 2.15.2 / 2.15.3

64 views
Skip to first unread message

Simon Riek

unread,
Aug 7, 2017, 8:08:38 PM8/7/17
to web...@googlegroups.com
Since updating from 2.14.6 to 2.15.2 (and also 2.15.3 released just moments ago) I have some problems with the default ExportClasses in SQLFORM.grid.
I am using MSSQL as database.
The grid displays just fine, only the export faild (to tsv and, in some cases, to csv - I did not test others).

I'll spare you the complete traceback and get directly to what I could find by implementing my own ExportClass.

At first I got a <type 'exceptions.AttributeError'>, the relevant traceback was:
File "C:\Users\riek\PycharmProjects\web2py\gluon\sqlhtml.py", line 3563, in represented
    row
.append(record._extra[col])
I didn't use any type _extra fields, meaning that the regex check in line 3562 failed (self.rows.db._adapter.REGEX_TABLE_DOT_FIELD.match(col)).

I then overwrote the "represented"-Function with my own, ignoring this check and forcing the else-branch. 

This lead to the following exception: <type 'exceptions.AttributeError'> 'DAL' object has no attribute '"t_schule"'. So my tables and fields are quoted and thus not found.

I tried a solution I found somewhere else, setting entity_quoting=False in my DAL-instance, didn't change anything.

I then searched some more and found this bugfix: https://github.com/web2py/web2py/issues/1542
It appears that this fix quotes the tables and fields, no matter if entity_quoting is enabled or not.

I could solve my particular problem with an ugly hack, by removing the quotes in the represent-function of my ExportClass (line 3565 in sqlhtml.py: (t, f) = col.replace('"','').split('.')  instead of (t, f) = col.split('.')) 
I am wondering though if this is a bug or I am not properly understanding how the quoting works.




Massimo Di Pierro

unread,
Aug 12, 2017, 5:02:36 PM8/12/17
to web2py-users
I opened an issue: https://github.com/web2py/web2py/issues/1733 
will be taken care of asap.
Reply all
Reply to author
Forward
0 new messages