Hi,
I encountered the captioned error when I moved my app from GAE to MySQL
+Apache. After a few tests I narrowed down to the following demo to
replicate the error (the 'customer' table contains only one record:
name='John', age=25):
# Encounter exception if I use the 'shortcut' syntax to update the
record AND the input data is the same as those already in the DB
def test():
customer=db(db.customer).select().first()
db.customer[customer.id] = dict(name='John',age=25)
return dict()
# No problem if I use the 'normal' syntax OR some input is different
from those in DB
def test2():
customer = db(db.customer).select().first()
customer.update(name='John',age=25)
return dict()
Traceback (most recent call last):
File "C:\web2py1.91.6\gluon\restricted.py", line 188, in restricted
exec ccode in environment
File "C:/web2py1.91.6/applications/welcome/controllers/default.py",
line 85, in <module>
File "C:\web2py1.91.6\gluon\globals.py", line 95, in <lambda>
self._caller = lambda f: f()
File "C:/web2py1.91.6/applications/welcome/controllers/default.py",
line 57, in test
db.customer[customer.id] = dict(name='John',age=25)
File "C:\web2py1.91.6\gluon\dal.py", line 3808, in __setitem__
raise SyntaxError, 'No such record: %s' % key
SyntaxError: No such record: 1
I am using Windows, XAMPP (Apache/2.2.14 mod_wsgi/3.3 Python/2.6.5
MySQL server version: 5.1.41)
Anyone having similar problem with MySQL?
Thanks
Mic