did you turned lazy_tables to True on your db definition? Bruno Rocha http://rochacbruno.com.br mobile Em 31/08/2012 10:02, "Jim S" <[email protected]> escreveu:
> Getting the following: > > Traceback (most recent call last): > File "C:\dev\web2py\gluon\restricted.py", line 209, in restricted > exec ccode in environment > File "C:/dev/web2py/applications/infocenter/models/db.py" > <http://127.0.0.1:8000/admin/default/edit/infocenter/models/db.py>, line 152, > in <module> > format='%(name)s') > File "C:\dev\web2py\gluon\dal.py", line 7047, in define_table > table = self.lazy_define_table(tablename,*fields,**args) > File "C:\dev\web2py\gluon\dal.py", line 7078, in lazy_define_table > polymodel=polymodel) > File "C:\dev\web2py\gluon\dal.py", line 920, in create_table > fake_migrate=fake_migrate) > File "C:\dev\web2py\gluon\dal.py", line 988, in migrate_table > and not isinstance(table[key].type, SQLCustomType) \ > File "C:\dev\web2py\gluon\dal.py", line 7559, in __getitem__ > return ogetattr(self, str(key)) > AttributeError: 'Table' object has no attribute 'permissionid' > > Relevant define_table in db.py: > > link = db.define_table('link', > Field('linkId', 'id', readable=False), > Field('name', length=50, required=True, unique=True), > Field('parentLinkId', 'reference link', required=True, > label='Parent Link'), > Field('controller', length=512, required=True), > Field('method', length=512, required=True), > Field('picture', length=512, required=False), > Field('permissionId', db.auth_permission, label='Rqd Permission'), > Field('groupId', db.auth_group, label='Rqd Group'), > Field('description', 'text', required=True), > format='%(name)s') > > > This is line 152. If I change it to the following (added .id to > definition of permissionId field reference) : > > link = db.define_table('link', > Field('linkId', 'id', readable=False), > Field('name', length=50, required=True, unique=True), > Field('parentLinkId', 'reference link', required=True, > label='Parent Link'), > Field('controller', length=512, required=True), > Field('method', length=512, required=True), > Field('picture', length=512, required=False), > Field('permissionId', db.auth_permission.id, label='Rqd Permission'), > Field('groupId', db.auth_group, label='Rqd Group'), > Field('description', 'text', required=True), > format='%(name)s') > > Then I get the following traceback: > > Traceback (most recent call last): > File "C:\dev\web2py\gluon\restricted.py", line 209, in restricted > exec ccode in environment > File "C:/dev/web2py/applications/infocenter/models/db.py" > <http://127.0.0.1:8000/admin/default/edit/infocenter/models/db.py>, line 152, > in <module> > format='%(name)s') > File "C:\dev\web2py\gluon\dal.py", line 7047, in define_table > table = self.lazy_define_table(tablename,*fields,**args) > File "C:\dev\web2py\gluon\dal.py", line 7078, in lazy_define_table > polymodel=polymodel) > File "C:\dev\web2py\gluon\dal.py", line 721, in create_table > elif field_type.startswith('reference'): > File "C:\dev\web2py\gluon\dal.py", line 8122, in startswith > raise SyntaxError, "startswith used with incompatible field type" > SyntaxError: startswith used with incompatible field type > > Any ideas where to look for this one? > > -Jim > > -- > > > > --

