I tested again in 3.0.8. The fix for the Exporter class in gluon/sqlhtml.py introduced a new error:
<class 'AttributeError'> 'DAL' object has no attribute 'compute'
Version
web2py™
Version 3.0.8-stable+timestamp.2024.12.01.23.08.05
Python
Python 3.11.2: /home/web2py/myappenv/bin/uwsgi (prefix: /home/web2py/myappenv)
Traceback (most recent call last):
File "/home/web2py/myapp/gluon/restricted.py", line 214, in restricted
exec(ccode, environment)
File "/home/web2py/myapp/applications/mgmtbonusform/controllers/target.py", line 2112, in <module>
File "/home/web2py/myapp/gluon/globals.py", line 474, in <lambda>
self._caller = lambda f: f()
^^^
File "/home/web2py/myapp/gluon/tools.py", line 4514, in f
return action(*a, **b)
^^^^^^^^^^^^^^^
File "/home/web2py/myapp/applications/mgmtbonusform/controllers/target.py", line 2109, in export_data
raise HTTP(200, oExp.export(), **response.headers)
^^^^^^^^^^^^^
File "/home/web2py/myapp/applications/mgmtbonusform/models/utilities.py", line 139, in export
records = self.represented()
^^^^^^^^^^^^^^^^^^
File "/home/web2py/myapp/gluon/sqlhtml.py", line 4323, in represented
field = self.rows.db[t][f]
~~~~~~~~~~~~^^^
File "/home/web2py/myapp/gluon/packages/pydal/pydal/base.py", line 776, in __getitem__
return self.__getattr__(str(key))
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/web2py/myapp/gluon/packages/pydal/pydal/base.py", line 788, in __getattr__
return BasicStorage.__getattribute__(self, key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'DAL' object has no attribute 'compute'
I suppose the VirtualField inserted into the Row is the problem.
Adding the original if-branch resolves it for my situation, but I am not sure if it has other implications:
if "." not in col:
row.append(record._extra[col])
elif not self.rows.db._adapter.REGEX_TABLE_DOT_FIELD.match(col):
(t, f) = [name.strip('"') for name in col.split(".")]
row.append(record[t][f])
else:
# The grid code modifies rows.colnames, adding double quotes
# around the table and field names -- so they must be removed here.
(t, f) = [name.strip('"') for name in col.split(".")]
field = self.rows.db[t][f]