summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/proxy.py
diff options
context:
space:
mode:
authorJonathan Ellis <jbellis@gmail.com>2006-07-21 16:53:05 +0000
committerJonathan Ellis <jbellis@gmail.com>2006-07-21 16:53:05 +0000
commit52c50cb72be72c6caed7bc0c5a29e9f18831c3d3 (patch)
treebf6d76e3eb1a915c94b72cc28e7bfbcb9a843371 /lib/sqlalchemy/ext/proxy.py
parent6fed7d0166e96acbeb2b7fa6e46c4747e9529d57 (diff)
downloadsqlalchemy-52c50cb72be72c6caed7bc0c5a29e9f18831c3d3.tar.gz
_selectable interface; allows sqlsoup to pass its classes to Join and have the underlying Table pulled out
Diffstat (limited to 'lib/sqlalchemy/ext/proxy.py')
-rw-r--r--lib/sqlalchemy/ext/proxy.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/sqlalchemy/ext/proxy.py b/lib/sqlalchemy/ext/proxy.py
index deced55b4..60972a6d5 100644
--- a/lib/sqlalchemy/ext/proxy.py
+++ b/lib/sqlalchemy/ext/proxy.py
@@ -68,8 +68,6 @@ class ProxyEngine(BaseProxyEngine):
BaseProxyEngine.__init__(self)
# create the local storage for uri->engine map and current engine
self.storage = local()
- self.storage.connection = {}
- self.storage.engine = None
self.kwargs = kwargs
def connect(self, *args, **kwargs):
@@ -87,13 +85,13 @@ class ProxyEngine(BaseProxyEngine):
self.storage.engine = None
map = self.storage.connection
try:
- self.engine = map[key]
+ self.storage.engine = map[key]
except KeyError:
map[key] = create_engine(*args, **kwargs)
self.storage.engine = map[key]
def get_engine(self):
- if self.storage.engine is None:
+ if not hasattr(self.storage, 'engine') or self.storage.engine is None:
raise AttributeError("No connection established")
return self.storage.engine