From 69ef29bc2d09fe16e838c4d0ee530e15ad1f3950 Mon Sep 17 00:00:00 2001 From: Michele Comitini Date: Fri, 6 Sep 2013 05:56:17 +0200 Subject: [PATCH] trying to fix some speed issues --- gluon/dal.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/gluon/dal.py b/gluon/dal.py index 82ab5654..a695a1b6 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -7049,14 +7049,14 @@ class Row(object): __getattr__ = __getitem__ - def __getattribute__(self, key): - try: - return object.__getattribute__(self, key) - except AttributeError, ae: - try: - return self.__get_lazy_reference__(key) - except: - raise ae + # def __getattribute__(self, key): + # try: + # return object.__getattribute__(self, key) + # except AttributeError, ae: + # try: + # return self.__get_lazy_reference__(key) + # except: + # raise ae def __eq__(self,other): try: @@ -10180,13 +10180,15 @@ class LazyReferenceGetter(object): def __init__(self, table, id): self.db, self.tablename, self.id = table._db, table._tablename, id def __call__(self, other_tablename): + if self.db._lazy_tables is False: + raise AttributeError() table = self.db[self.tablename] other_table = self.db[other_tablename] for rfield in table._referenced_by: if rfield.table == other_table: return LazySet(rfield, self.id) - return None + raise AttributeError() class LazySet(object): def __init__(self, field, id):