I've been away for a few days but came back today and updated my install
again. Now this is working on the list page from .smartgrid, but when I
try to update a record I'm getting the following traceback...
Traceback(most recent call last):
File"C:\dev\web2py\gluon\restricted.py",line204,inrestricted
execccodeinenvironment
File"C:/dev/web2py/applications/infocenter/controllers/administration.py"
<http://127.0.0.1:8000/admin/default/edit/infocenter/controllers/administration.py>,line1816,in<module>
File"C:\dev\web2py\gluon\globals.py",line172,in<lambda>
self._caller=lambdaf:f()
File"C:\dev\web2py\gluon\tools.py",line2551,inf
returnaction(*a, **b)
File"C:/dev/web2py/applications/infocenter/controllers/administration.py"
<http://127.0.0.1:8000/admin/default/edit/infocenter/controllers/administration.py>,line457,inassetTypes
paginate=15,maxtextlength=45)
File"C:\dev\web2py\gluon\sqlhtml.py",line1975,insmartgrid
user_signature=user_signature,**kwargs)
File"C:\dev\web2py\gluon\sqlhtml.py",line1593,ingrid
next=referrer)
File"C:\dev\web2py\gluon\html.py",line1960,inprocess
self.validate(**kwargs)
File"C:\dev\web2py\gluon\html.py",line1907,invalidate
if self.accepts(**kwargs):
File"C:\dev\web2py\gluon\sqlhtml.py",line1088,inaccepts
hideerror=hideerror,
File"C:\dev\web2py\gluon\html.py",line1807,inaccepts
status=self._traverse(status,hideerror)
File"C:\dev\web2py\gluon\html.py",line749,in_traverse
newstatus=c._traverse(status,hideerror)andnewstatus
File"C:\dev\web2py\gluon\html.py",line749,in_traverse
newstatus=c._traverse(status,hideerror)andnewstatus
File"C:\dev\web2py\gluon\html.py",line749,in_traverse
newstatus=c._traverse(status,hideerror)andnewstatus
File"C:\dev\web2py\gluon\html.py",line749,in_traverse
newstatus=c._traverse(status,hideerror)andnewstatus
File"C:\dev\web2py\gluon\html.py",line756,in_traverse
newstatus=self._validate()
File"C:\dev\web2py\gluon\html.py",line1572,in_validate
(value,errors) =validator(value)
File"C:\dev\web2py\gluon\validators.py",line549,in__call__
elifstr(rows[0]._id) !=str(self.record_id):
File"C:\dev\web2py\gluon\dal.py",line5466,in__getattr__
return self[key]
File"C:\dev\web2py\gluon\dal.py",line5457,in__getitem__
returndict.__getitem__(self,key)
KeyError:'_id'
I'm assuming it has something to do with my use of primary key-field
being something other than 'id'. Here is the setup for the tables being
updated in this case:
assetType = db.define_table('assetType',
Field('assetTypeId', 'id'),
Field('name', length=50, required=True, unique=True),
format='%(name)s')
assetType.name.requires = [IS_NOT_EMPTY(),
IS_NOT_IN_DB(db, 'assetType.name')]
assetType['_plural'] = 'Asset Types'
-Jim
On 1/19/2012 10:45 AM, Jim Steil wrote:
Hi
Just updated to the latest trunk this morning and now my smartgrids
aren't working where the table being used has links.
Here is what I'm getting:
Traceback(most recent call last):
File"C:\dev\web2py\gluon\restricted.py",line204,inrestricted
execccodeinenvironment
File"C:/dev/web2py/applications/infocenter/controllers/administration.py"
<http://127.0.0.1:8000/admin/default/edit/infocenter/controllers/administration.py>,line1816,in<module>
File"C:\dev\web2py\gluon\globals.py",line172,in<lambda>
self._caller=lambdaf:f()
File"C:\dev\web2py\gluon\tools.py",line2530,inf
returnaction(*a, **b)
File"C:/dev/web2py/applications/infocenter/controllers/administration.py"
<http://127.0.0.1:8000/admin/default/edit/infocenter/controllers/administration.py>,line457,inassetTypes
paginate=15,maxtextlength=45)
File"C:\dev\web2py\gluon\sqlhtml.py",line1971,insmartgrid
user_signature=user_signature,**kwargs)
File"C:\dev\web2py\gluon\sqlhtml.py",line1819,ingrid
iflink(row):
File"C:\dev\web2py\gluon\sqlhtml.py",line1968,in<lambda>
args=request.args[:nargs]+[args0,row.id])))
File"C:\dev\web2py\gluon\dal.py",line4996,in__getattr__
return self[key]
File"C:\dev\web2py\gluon\dal.py",line4987,in__getitem__
returndict.__getitem__(self,key)
KeyError:'id'
If the table doesn't have any fields referencing other tables, then it
works fine.
Is it just me?
-Jim