>
> 1) Regarding to the update:

As far as I know, to update a row I should do something like this:
>    query = db(db.table.field1=='What I am looking for')
>    query.update(field2='hello')   
>    rows = query.select()
>
>    row = rows[0]
>    row.update_record()
>
>
Note, you could also have done something like this:

row = db(db.table.field1=='What I am looking for').select().first()
row.update(field2='hello')
row.update_record()


row.update(...) only updates the row object itself, not the associated 
record in the database. However, if you make one or more updates to the row 
object, you can subsequently call row.update_record() with no arguments, 
and it will propagate the row updates to the database (as a single update). 
That is probably the example in the book to which you are referring, shown 
at the end of this 
section<http://web2py.com/books/default/chapter/29/06#update_record>
.

Anthony


-- 



Reply via email to