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
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
2 matches
Mail list logo