From 52c50cb72be72c6caed7bc0c5a29e9f18831c3d3 Mon Sep 17 00:00:00 2001 From: Jonathan Ellis Date: Fri, 21 Jul 2006 16:53:05 +0000 Subject: _selectable interface; allows sqlsoup to pass its classes to Join and have the underlying Table pulled out --- lib/sqlalchemy/ext/proxy.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/sqlalchemy/ext/proxy.py') 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 -- cgit v1.2.1