Re: [web2py] Re: Strange behavior using a function to update a record

2011-11-17 Thread Vinicius Assef
Anthony, I understand that. If set.update() updates data on a collection of records, row.update() should update data in just one record. It makes more sense to me. Web2py newcomers think about using row.update() to update data on db. It's is a trick, in my oppinion. Aftwards, Row represents a row

Re: [web2py] Re: Strange behavior using a function to update a record

2011-11-17 Thread Anthony
On Thursday, November 17, 2011 4:19:16 PM UTC-5, viniciusban wrote: > > I'm saying that: > row.update() doesn't alter database contents, as set.update() does. > > Same verb, different behaviour. > Why should it have the same behavior -- it's the same verb, but operating on instances of different c

Re: [web2py] Re: Strange behavior using a function to update a record

2011-11-17 Thread Vinicius Assef
I'm saying that: row.update() doesn't alter database contents, as set.update() does. Same verb, different behaviour. On Thu, Nov 17, 2011 at 4:50 PM, Anthony wrote: > On Thursday, November 17, 2011 12:21:08 PM UTC-5, viniciusban wrote: >> >> By the way, isn't it quite strange that same verb (u

Re: [web2py] Re: Strange behavior using a function to update a record

2011-11-17 Thread Anthony
On Thursday, November 17, 2011 12:21:08 PM UTC-5, viniciusban wrote: > > By the way, isn't it quite strange that same verb (update) being used > to make two different things? What do you mean?

Re: [web2py] Re: Strange behavior using a function to update a record

2011-11-17 Thread Vinicius Assef
By the way, isn't it quite strange that same verb (update) being used to make two different things? On Wed, Nov 16, 2011 at 12:12 PM, Anthony wrote: > On Wednesday, November 16, 2011 8:57:10 AM UTC-5, Tito Garrido wrote: >> >> "sandbox/models/db_functions.py" >> >> def test(id): >>     r=db.myt

Re: [web2py] Re: Strange behavior using a function to update a record

2011-11-16 Thread Tito Garrido
Good Catch both of you! :-) update_record works! Thanks! On Wed, Nov 16, 2011 at 12:12 PM, Anthony wrote: > On Wednesday, November 16, 2011 8:57:10 AM UTC-5, Tito Garrido wrote: >> >> "sandbox/models/db_functions.**py" >> def test(id): >> r=db.mytable[id] >> r.update(state=55) > > > In

[web2py] Re: Strange behavior using a function to update a record

2011-11-16 Thread Anthony
On Wednesday, November 16, 2011 8:57:10 AM UTC-5, Tito Garrido wrote: > > "sandbox/models/db_functions.py" > def test(id): > r=db.mytable[id] > r.update(state=55) In the above, 'r' is a Row object, so all you are doing is updating the Row object itself, not the original record in the db.