Oops, more answers follow:
On May 2, 8:23 am, Brian <[email protected]> wrote:
> 2) What's the difference between an update and an update_record?
update works on a set of records:
db(db.person.id>3).update(name='Ken')
update_record is for a single record:
rows=db(db.person.id>2).select()
row=rows[0]
row.update_record(name='Curt')
> 3) With the above example, is there anyway I can use a variable for a
> field name? So instead of having a bunch of if's and elif's to go
> through the field, I could do a:
> db(row).update(updatedField = updatedData)
The parameters are passed as a dictionary so you could create one.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---