From 24077f802b853e2944352929da0bd4efa8482ba7 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Fri, 21 Jun 2013 10:16:10 -0500 Subject: [PATCH] allow compute fields to depend on compute fields defined earlier, thanks Tim Richardson --- VERSION | 2 +- gluon/dal.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index d3bb6729..d6ff3003 100644 --- a/VERSION +++ b/VERSION @@ -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 diff --git a/gluon/dal.py b/gluon/dal.py index c5d1d09a..3b9f9f26 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -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: