Hello,
I know this has been flagged in past. Still I could not find a clean 
solution to handle such events.
When either updating or updating record if fields/keys used in compute are 
not provided it throws a KeyError.
Ok I can handle that no problem. Try,except: pass, but If I do pass it 
assigns compute None. While if I have id I can perform some operations in 
order to get previous values... but sometimes I am performing an update and 
I dont have id.

Compute fields seem very useful.
They are nice because with VirtualFields they are recalculated everytime I 
get records which is not good for performance.
While with LazyFields I have to treat them as methods of model sort of and 
run them everytime I do something.

Has anyone came up with idea for fixing compute fields?
My solution would be to not accept compute function return None. If it 
returns None than field should not change form its previous value.

-- 



Reply via email to