From: Tony Mack Date: Thu, 9 Jul 2009 20:40:10 +0000 (+0000) Subject: access dictionary by key instead of getattr X-Git-Tag: sfa-0.9-0@14641~85 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=df432c2cbb7993f0e6c4a5d44b765de195639ba8;p=sfa.git access dictionary by key instead of getattr --- diff --git a/sfa/util/record.py b/sfa/util/record.py index 35b5faaa..4b01edf2 100644 --- a/sfa/util/record.py +++ b/sfa/util/record.py @@ -214,7 +214,10 @@ class GeniRecord(dict): if fieldname == "key": val = self.get_key() else: - val = self[fieldname] + try: + val = getattr(self, fieldname) + except: + val = self[fieldname] if isinstance(val, str): return "'" + str(val) + "'" else: