I expect to get "Profile: info@example.com aka Mr. Alias" but I'm getting instead Internal Error with traceback:
Traceback (most recent call last):
File ".../web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
File ".../web2py/applications/myapp/controllers/default.py:test", line 103, in
File ".../web2py/gluon/globals.py", line 95, in
self._caller = lambda f: f()
File ".../web2py/applications/myapp/controllers/default.py:test", line 16, in test
File ".../web2py/gluon/dal.py", line 3913, in insert
return self._db._adapter.insert(self,self._listify(fields))
File ".../web2py/gluon/dal.py", line 2763, in insert
dfields=dict((f.name,self.represent(v,f.type)) for f,v in fields)
File ".../web2py/gluon/dal.py", line 2763, in
dfields=dict((f.name,self.represent(v,f.type)) for f,v in fields)
File ".../web2py/gluon/dal.py", line 2316, in represent
if fieldtype.startswith('list:'):
AttributeError: 'UserProperty' object has no attribute 'startswith'
The simple patch in the attachment eliminates the issue, but I'm not sure about possible side-effects. Can you please review and incorporate?
From roman.imankulov on January 22, 2011 05:22:52
The issue can be easily reproduced with the following code snippet (I suppose it's a controller):
def test(): from gluon.contrib.gql import gae from google.appengine.api import users
define tables
I expect to get "Profile: info@example.com aka Mr. Alias" but I'm getting instead Internal Error with traceback:
Traceback (most recent call last): File ".../web2py/gluon/restricted.py", line 188, in restricted exec ccode in environment File ".../web2py/applications/myapp/controllers/default.py:test", line 103, in
File ".../web2py/gluon/globals.py", line 95, in
self._caller = lambda f: f()
File ".../web2py/applications/myapp/controllers/default.py:test", line 16, in test
File ".../web2py/gluon/dal.py", line 3913, in insert
return self._db._adapter.insert(self,self._listify(fields))
File ".../web2py/gluon/dal.py", line 2763, in insert
dfields=dict((f.name,self.represent(v,f.type)) for f,v in fields)
File ".../web2py/gluon/dal.py", line 2763, in
dfields=dict((f.name,self.represent(v,f.type)) for f,v in fields)
File ".../web2py/gluon/dal.py", line 2316, in represent
if fieldtype.startswith('list:'):
AttributeError: 'UserProperty' object has no attribute 'startswith'
The simple patch in the attachment eliminates the issue, but I'm not sure about possible side-effects. Can you please review and incorporate?
Attachment: dal.diff
Original issue: http://code.google.com/p/web2py/issues/detail?id=163