Hello,

In the book section :

http://web2py.com/book/default/chapter/06?search=update#update_record

We talk about single record...

But command 1 is not selecting a single record so if there is other id
then 3 (4, 5, 6, etc.) there will be a error in what we expect to
update...

Book extract :
update_record
update_record web2py also allows updating a single record that is
already in memory using update_record
1.
2.
>>> row = db(db.person.id > 2).select().first()
>>> row.update_record(name='Curt')

Should be :
>>> row = db(db.person.id == 2).select().first()

Maybe it's not going to do bad thing because of .first(), but I think
it clearer with "=="

Richard

Reply via email to