with row[sum] it doesn't work <type 'exceptions.KeyError'>('<built-in function sum>')
"Actually, the above will only work if the controller returns 'sum' in the dictionary -- otherwise it will be undefined in the view." what shoul i change in the controller?