preventing un-necessary fetch, thans Anthony and Villas

This commit is contained in:
Massimo
2013-09-03 09:53:42 -05:00
parent 099e02fe64
commit fd000fe35b
2 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.6.0-development+timestamp.2013.09.02.20.41.19
Version 2.6.0-development+timestamp.2013.09.03.09.52.37
+6 -2
View File
@@ -8212,8 +8212,12 @@ class Reference(long):
def __getattr__(self, key):
if key == 'id':
return long(self)
self.__allocate()
return self._record.get(key, None)
if key in self._table:
self.__allocate()
if self._record:
return self._record.get(key,None) # to deal with case self.update_record()
else:
return None
def get(self, key, default=None):
return self.__getattr__(key, default)