Il 22/02/2011 20:26, Massimo Di Pierro ha scritto:
Consider this:
db.define_table('t',Field('a'),Field('b'),Field('b',compute=lambda
row: row['a']+row['b'])
these works (update)
db.t.insert(a='x',b='y')
db(query).update(a='x',b='y')
for row in db(query).select(): row.update_record(a='x',b=row.b)
db(query).update(c=db.t.x+db.t.y)
did you mean:
db(query).update(c=db.t.a + db.t.b)
anyway why I have to explicit again my formula when it's already defined
in field definition?
Is it possible to add this example in the manual? it doesn't look to me
so easy...
Thank you so much
Cheers
Manuele
...
but this does not
db(query).update(a='x')
because no enough info is provided.
On Feb 22, 9:39 am, Manuele Pesenti<[email protected]> wrote:
Dear users,
if I change a value in a function called by e computed field formula how
can I update the computed field values?
I tryed
db(db.tab.id>0).update(id=db.tab.id)
but nothing happened
Thank you
Manuele