A while ago I posted a message about an error I got while trying to
register as a user of my app running on local GAE. Later got a very
similar error testing the Lost Password link and some of my app code.
I am running we2py 1.86.2 and using Python 2.5 for the local GAE with
Windows Vista. Here is the error message:
Traceback (most recent call last):
File "C:\webdev\web2py\gluon\restricted.py", line 188, in restricted
exec ccode in environment
File "C:\webdev\web2py\applications\welcome/controllers/
default.py:user", line 57, in <module>
File "C:\webdev\web2py\gluon\globals.py", line 96, in <lambda>
self._caller = lambda f: f()
File "C:\webdev\web2py\applications\welcome/controllers/
default.py:user", line 34, in user
File "C:\webdev\web2py\gluon\tools.py", line 1028, in __call__
return self.register()
File "C:\webdev\web2py\gluon\tools.py", line 1627, in register
table_user[form.vars.id] = dict(registration_key='')
File "C:\webdev\web2py\gluon\sql.py", line 1672, in __setitem__
elif not self._db(self._id == key)\
File "C:\webdev\web2py\gluon\sql.py", line 1683, in __getattr__
return dict.__getitem__(self,key)
KeyError: '_id'
After some trial and error, I changed File "C:\webdev\web2py\gluon
\tools.py", line 1627 from
table_user[form.vars.id] = dict(registration_key='') # into
self.db(table_user.id == form.vars.id).update(registration_key='')
and the error went away! These 2 lines should be equivalent, but
something about them is different. To fix the Lost Password error, I
made a similar change at File "C:\webdev\web2py\gluon\tools.py", line
1992 from
user.update_record(reset_password_key=reset_password_key) # into
self.db(table_user.id ==
user.id).update(reset_password_key=reset_password_key)
Why would these changes make any difference? Is it possible to include
these changes in a future release?
By the way, I am really enjoying web2py. It's a joy to work with. Now
I am working on trying to understand the real GAE, mainly the bulk
loader tool and the mapreduce function so I can upload and delete
large numbers of records more efficiently. Thanks,
Chuck Paulson