Hello,
I've been trying to update a column using appadmin (something='value')
and for some reason the computed columns aren't being calculated
correctly. I have a field like this in the DAL:
Field('linked_pages',compute = lambda(r):
story_viewer.get_linked_pages(r['text'])),
and a KeyError shows up with 'text' as the missing key in row r.
------
One level up the stack: I know the column exists, but it appears that
it's not getting passed in Set._update's **update_fields, so this
block of code:
update_fields.update(dict([(fieldname,
table[fieldname].compute(Row(update_fields))) \
for fieldname in table.fields \
if not fieldname in
update_fields \
and table[fieldname].compute !=
None]))
(gluon.sql.py)
results in the KeyError, when it calls compute.
This bit of code appears to recompute fields if they 1) haven't been
directly updated and 2) have compute functions. Trouble is,
appadmin.py/select uses form.vars.update_fields as the argument it
passes to update, which only includes the fields I requested an update
for, and not the 'text' field.
------
Is there something I'm missing? How is this supposed to behave?
Thanks!