Merge branch 'master' into sqlalchemy
[sfa.git] / sfa / rspecs / elements / element.py
index a2febfc..7f79e81 100644 (file)
@@ -11,9 +11,11 @@ class Element(dict):
             if key in fields:
                 self[key] = fields[key] 
 
-    def __getattr__(self, attr):
-        if hasattr(self, attr):
-            return getattr(self, attr)
-        elif self.element is not None and hasattr(self.element, attr):
-            return getattr(self.element, attr)
-        raise AttributeError, "Element class has no attribute %s" % attr
+
+    def __getattr__(self, name):
+        if hasattr(self.__dict__, name):
+            return getattr(self.__dict__, name)
+        elif hasattr(self.element, name):
+            return getattr(self.element, name)
+        else:
+            raise AttributeError, "class Element has no attribute %s" % name