Traceback (most recent call last): File "/Users/web2py/web2py/gluon/restricted.py", line 219, in restricted exec(ccode, environment) File "<string>", line 83, in <module> File "/Users/web2py/web2py/gluon/globals.py", line 422, in write self.body.write(to_native(xmlescape(data))) File "/Users/web2py/web2py/gluon/html.py", line 125, in xmlescape return to_bytes(data.xml()) File "/Users/web2py/web2py/gluon/html.py", line 960, in xml (fa, co) = self._xml() File "/Users/web2py/web2py/gluon/html.py", line 952, in _xml co = b''.join([xmlescape(component) for component in self.components]) File "/Users/web2py/web2py/gluon/html.py", line 125, in xmlescape return to_bytes(data.xml()) File "/Users/web2py/web2py/gluon/html.py", line 960, in xml (fa, co) = self._xml() File "/Users/web2py/web2py/gluon/html.py", line 952, in _xml co = b''.join([xmlescape(component) for component in self.components]) File "/Users/web2py/web2py/gluon/html.py", line 125, in xmlescape return to_bytes(data.xml()) File "/Users/web2py/web2py/gluon/html.py", line 960, in xml (fa, co) = self._xml() File "/Users/web2py/web2py/gluon/html.py", line 952, in _xml co = b''.join([xmlescape(component) for component in self.components]) File "/Users/web2py/web2py/gluon/html.py", line 125, in xmlescape return to_bytes(data.xml()) File "/Users/web2py/web2py/gluon/html.py", line 960, in xml (fa, co) = self._xml() File "/Users/web2py/web2py/gluon/html.py", line 952, in _xml co = b''.join([xmlescape(component) for component in self.components]) File "/Users/web2py/web2py/gluon/html.py", line 125, in xmlescape return to_bytes(data.xml()) File "/Users/web2py/web2py/gluon/html.py", line 960, in xml (fa, co) = self._xml() File "/Users/web2py/web2py/gluon/html.py", line 952, in _xml co = b''.join([xmlescape(component) for component in self.components]) File "/Users/web2py/web2py/gluon/html.py", line 125, in xmlescape return to_bytes(data.xml()) File "/Users/web2py/web2py/gluon/packages/dal/pydal/objects.py", line 2497, in xml rv = self.db.represent('rows_xml', self) File "/Users/web2py/web2py/gluon/packages/dal/pydal/base.py", line 834, in represent return self.representers[name](*args, **kwargs) File "/Users/web2py/web2py/gluon/sqlhtml.py", line 3322, in __init__ tablemap = dict(((f.tablename, f.table) for f in fieldmap.values())) File "/Users/web2py/web2py/gluon/sqlhtml.py", line 3322, in <genexpr> tablemap = dict(((f.tablename, f.table) for f in fieldmap.values()))AttributeError: 'Expression' object has no attribute 'tablename'
def dbselect(): only_after = t = db[ 'unique_sites' ] h = db[ 'TABLE_of_sites' ] max = h.last_updated.max() q = h.type_id==1 q&= h.last_updated>datetime.now()-timedelta(weeks=8) join = t.on(t.url==h.url) rows = db(q).select(t.ALL, max, groupby=t.ALL, join=join) # this produces the error above :( rows = db(q).select(t.ALL, max, groupby=t.ALL, join=join).as_list() #this doesn't throw the error :) return locals()
Version 2.15.2-stable+timestamp.2017.07.19.01.21.31
Postgresql 9.6 + psycopg2 adapter