[web2py] Re: automatically count field edits

2014-01-19 Thread Massimo Di Pierro
Field('edits', 'integer', default=0, update=(lambda r: (r['edits'] or 0) + 1 ), writable=False) On Saturday, 18 January 2014 21:27:06 UTC-6, Jaime Sempere wrote: I'm trying to automatically count each time a record is being updated. I could make a lambda function that worked for a

[web2py] Re: automatically count field edits

2014-01-18 Thread Jaime Sempere
I'm trying to automatically count each time a record is being updated. I could make a lambda function that worked for a dictionary: Field('edits', 'integer', compute=lambda r: int(r['edits'] or 0) + 1 ), However, I don't get this to work in practice. Can a lambda for edits not use its