allow compute fields to depend on compute fields defined earlier, thanks Tim Richardson

This commit is contained in:
mdipierro
2013-06-21 10:16:10 -05:00
parent 3ce0c30b68
commit 24077f802b
2 changed files with 3 additions and 4 deletions

View File

@@ -1 +1 @@
Version 2.5.1-stable+timestamp.2013.06.21.06.43.49
Version 2.5.1-stable+timestamp.2013.06.21.10.15.15

View File

@@ -8541,9 +8541,8 @@ class Table(object):
for name,ofield in to_compute:
# try compute it
try:
new_fields[name] = (ofield,ofield.compute(row))
__,fields[name] = new_fields[name] #the value is the second element of the tuple
row = Row(fields) #allow later compute fields to refer to this value
row[name] = new_value = ofield.compute(row)
new_fields[name] = (ofield, new_value)
except (KeyError, AttributeError):
# error silently unless field is required!
if ofield.required: