Thanks Áureo, good to know!

I use the other format because I do a few checks before doing the update, 
to see if the data is valid, but this short notation will no doubt be 
helpful in the future :)

Ricardo.

On Wednesday, January 4, 2017 at 11:06:05 AM UTC, Áureo Dias Neto wrote:
>
> Hello,
>
> You can do this, for update
>
> db(db.person.id==1).update(name='Tim')
>
>
> 2017-01-04 9:01 GMT-02:00 Ricardo Oliveira <[email protected] 
> <javascript:>>:
>
>> Hi Anthony,
>>
>> Thanks for your reply.
>> I'm using the DAL's insert method for the creation. Eg:
>>
>> db.table_x.insert(name='something')
>>
>> For updates, I get the rows from the table first, change the values on 
>> the row object and then use the update_record() method for updating. Eg:
>>
>> record = db(db.table_x.id == row_id).select().first()
>> record['name'] = 'something else'
>> record.update_record()
>>
>>
>> Thanks.
>> Ricardo.
>>
>>
>> On Friday, December 23, 2016 at 10:40:01 PM UTC, Anthony wrote:
>>>
>>> 2) the user & time are not recorded on the modified_on, modified_by 
>>>> columns
>>>>
>>>
>>> How are you creating/updating the records?
>>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to